Commit f428a123 authored by Jia Zhouyang's avatar Jia Zhouyang Committed by Sergei Golubchik

MDEV-15550 Add error handling for fopen

Print error message and return when fopen fails.

Closes #634
parent d218b5c3
......@@ -365,6 +365,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment