fixed a bug with waitpid() - I'd forgotten about WEXITSTATUS !

This commit is contained in:
Andrew Tridgell committed 1999-12-09 06:46:11 +00:00
1 parent a7d068abff
commit d79d1c69f7
2 files changed
+12 -3

No files matched your search

+3 -3
View File
@@ -310,7 +310,7 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name)
generate_files(f_out,flist,local_name,recv_pipe[0]);
io_flush();
waitpid(pid, &status, 0);
wait_process(pid, &status);
return status;
}
@@ -406,7 +406,7 @@ int client_run(int f_in, int f_out, int pid, int argc, char *argv[])
if (verbose > 3)
rprintf(FINFO,"client_run waiting on %d\n",pid);
io_flush();
waitpid(pid, &status, 0);
wait_process(pid, &status);
}
report(-1);
exit_cleanup(status);
@@ -430,7 +430,7 @@ int client_run(int f_in, int f_out, int pid, int argc, char *argv[])
if (verbose > 3)
rprintf(FINFO,"client_run2 waiting on %d\n",pid);
io_flush();
waitpid(pid, &status, 0);
wait_process(pid, &status);
}
return status | status2;
+9
View File
@@ -870,3 +870,12 @@ char *timestring(time_t t)
return(TimeBuf);
}
/****************************************************************************
like waitpid but does the WEXITSTATUS
****************************************************************************/
void wait_process(pid_t pid, int *status)
{
waitpid(pid, status, 0);
*status = WEXITSTATUS(*status);
}