summaryrefslogtreecommitdiff
path: root/client/mysql_plugin.c
diff options
context:
space:
mode:
authorGalina Shalygina <galina.shalygina@mariadb.com>2018-06-01 21:57:10 +0200
committerGalina Shalygina <galina.shalygina@mariadb.com>2018-06-01 21:57:10 +0200
commit6db465d7ce455cf75ec224108cbe61ca8be63d3d (patch)
tree9648ff1fc677eebb60b278c2e2c13131934ed2a0 /client/mysql_plugin.c
parentffe83e8e7bef32eb2a80aad2d382f0b023dd3a44 (diff)
parent4a49f7f88cfa82ae6eb8e7b5a528e91416b33b52 (diff)
downloadmariadb-git-shagalla-10.4.tar.gz
Merge 10.3.7 into 10.4shagalla-10.4
Diffstat (limited to 'client/mysql_plugin.c')
-rw-r--r--client/mysql_plugin.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c
index 81677ad551f..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);
@@ -365,6 +364,12 @@ static int get_default_values()
}
/* Now open the file and read the defaults we want. */
file= fopen(defaults_file, "r");
+ if (file == NULL)
+ {
+ fprintf(stderr, "ERROR: failed to open file %s: %s.\n", defaults_file,
+ strerror(errno));
+ goto exit;
+ }
while (fgets(line, FN_REFLEN, file) != NULL)
{
char *value= 0;