It's not possible to use the return value of fputs

to check if the creation of mysql_upgrade_info suceeded.
Instead use 'upgrade_already_done' to check that file was
created properly.
parent b11a1c8f
...@@ -578,14 +578,20 @@ static void create_mysql_upgrade_info_file(void) ...@@ -578,14 +578,20 @@ static void create_mysql_upgrade_info_file(void)
return; return;
} }
/* Write new version to file, just print a message if it fails */ /* Write new version to file */
if (!fputs(MYSQL_SERVER_VERSION, out)) fputs(MYSQL_SERVER_VERSION, out);
my_fclose(out, MYF(0));
/*
Check if the upgrad_info_file was properly created/updated
It's not a fatal error -> just print a message if it fails
*/
if (!upgrade_already_done())
fprintf(stderr, fprintf(stderr,
"Could not write to the upgrade info file '%s' in " "Could not write to the upgrade info file '%s' in "
"the MySQL Servers datadir, errno: %d\n", "the MySQL Servers datadir, errno: %d\n",
upgrade_info_file, errno); upgrade_info_file, errno);
return;
my_fclose(out, MYF(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