mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Use a temp variable "error" for storing return code of pclose
so the WEXITSTATUS macro can "fiddle" with it as it so pleases
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user