summaryrefslogtreecommitdiff
path: root/client/mysql_plugin.c
diff options
context:
space:
mode:
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;