summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authormsvensson@pilot.blaudden <>2007-04-23 13:27:55 +0200
committermsvensson@pilot.blaudden <>2007-04-23 13:27:55 +0200
commit7ddc33753ec338969a205e5ff9904d74ccb973c7 (patch)
treedb424b646f7a4c6037e0a2c7e94d33708a12176c /client
parent714c36ce27a4915a6cb57dca23ed5f52a497c439 (diff)
downloadmariadb-git-7ddc33753ec338969a205e5ff9904d74ccb973c7.tar.gz
Use a temp variable "error" for storing return code of pclose
so the WEXITSTATUS macro can "fiddle" with it as it so pleases
Diffstat (limited to 'client')
-rw-r--r--client/mysql_upgrade.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index d7486327e1b..64de3d19882 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -250,6 +250,7 @@ static int run_command(char* cmd,
{
char buf[512]= {0};
FILE *res_file;
+ int error;
if (!(res_file= popen(cmd, "r")))
die("popen(\"%s\", \"r\") failed", cmd);
@@ -269,7 +270,8 @@ static int run_command(char* cmd,
}
}
- return WEXITSTATUS(pclose(res_file));
+ error= pclose(res_file);
+ return WEXITSTATUS(error);
}