summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authormsvensson@pilot.blaudden <>2007-04-23 13:07:49 +0200
committermsvensson@pilot.blaudden <>2007-04-23 13:07:49 +0200
commit714c36ce27a4915a6cb57dca23ed5f52a497c439 (patch)
treed84098718d89f8ba0bf04ee0160a758ad1db067c /client
parentb11a1c8fd459e662fb3a3317a206625461d52501 (diff)
downloadmariadb-git-714c36ce27a4915a6cb57dca23ed5f52a497c439.tar.gz
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.
Diffstat (limited to 'client')
-rw-r--r--client/mysql_upgrade.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index aeda47c48eb..d7486327e1b 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -578,14 +578,20 @@ static void create_mysql_upgrade_info_file(void)
return;
}
- /* Write new version to file, just print a message if it fails */
- if (!fputs(MYSQL_SERVER_VERSION, out))
+ /* Write new version to file */
+ 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,
"Could not write to the upgrade info file '%s' in "
"the MySQL Servers datadir, errno: %d\n",
upgrade_info_file, errno);
-
- my_fclose(out, MYF(0));
+ return;
}