Commit 09e6e661 authored by unknown's avatar unknown

Use a temp variable "error" for storing return code of pclose

so the WEXITSTATUS macro can "fiddle" with it as it so pleases
 

parent f1e81f6c
...@@ -250,6 +250,7 @@ static int run_command(char* cmd, ...@@ -250,6 +250,7 @@ static int run_command(char* cmd,
{ {
char buf[512]= {0}; char buf[512]= {0};
FILE *res_file; FILE *res_file;
int error;
if (!(res_file= popen(cmd, "r"))) if (!(res_file= popen(cmd, "r")))
die("popen(\"%s\", \"r\") failed", cmd); die("popen(\"%s\", \"r\") failed", cmd);
...@@ -269,7 +270,8 @@ static int run_command(char* cmd, ...@@ -269,7 +270,8 @@ static int run_command(char* cmd,
} }
} }
return WEXITSTATUS(pclose(res_file)); error= pclose(res_file);
return WEXITSTATUS(error);
} }
......
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