diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-05-17 22:53:57 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2018-05-21 16:34:10 +0000 |
commit | 3a7d7e180a871c5b2b2d98812d9d7f800cf33952 (patch) | |
tree | d4bd1765e16d3bf92d360b8c032b86f8a0b3a38f /client/mysql_plugin.c | |
parent | 2534ae20fd244eed569830bb7159518e42f24baa (diff) | |
download | mariadb-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.c | 3 |
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); |