summaryrefslogtreecommitdiff
path: root/client/mysql_plugin.c
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-05-17 22:53:57 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2018-05-21 16:34:10 +0000
commit3a7d7e180a871c5b2b2d98812d9d7f800cf33952 (patch)
treed4bd1765e16d3bf92d360b8c032b86f8a0b3a38f /client/mysql_plugin.c
parent2534ae20fd244eed569830bb7159518e42f24baa (diff)
downloadmariadb-git-3a7d7e180a871c5b2b2d98812d9d7f800cf33952.tar.gz
cleanup: create_temp_file()
simplify. move common code inside, specify common flags inside, rewrite dead code (`if (mode & O_TEMPORARY)` on Linux, where `O_TEMPORARY` is always 0) to actually do something.
Diffstat (limited to 'client/mysql_plugin.c')
-rw-r--r--client/mysql_plugin.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c
index d297f3cd03e..40560613a89 100644
--- a/client/mysql_plugin.c
+++ b/client/mysql_plugin.c
@@ -159,8 +159,7 @@ static int make_tempfile(char *filename, const char *ext)
{
int fd= 0;
- if ((fd=create_temp_file(filename, NullS, ext, O_CREAT | O_WRONLY,
- MYF(MY_WME))) < 0)
+ if ((fd= create_temp_file(filename, NullS, ext, 0, MYF(MY_WME))) < 0)
{
fprintf(stderr, "ERROR: Cannot generate temporary file. Error code: %d.\n",
fd);