X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/1f5c6343e6a3d55689073f60e71fd56cab42f89d..66203a982b3d249bafda9b9272c4c103c19e4a9b:/util.c diff --git a/util.c b/util.c index a0101657..078d59f5 100644 --- a/util.c +++ b/util.c @@ -367,17 +367,6 @@ int robust_rename(char *from, char *to) return -1; return do_rename(from, to); #endif - } - - -/* sleep for a while via select */ -void u_sleep(int usec) -{ - struct timeval tv; - - tv.tv_sec = 0; - tv.tv_usec = usec; - select(0, NULL, NULL, NULL, &tv); } @@ -870,3 +859,15 @@ char *timestring(time_t t) return(TimeBuf); } + +/**************************************************************************** + like waitpid but does the WEXITSTATUS +****************************************************************************/ +#ifndef WEXITSTATUS +#define WEXITSTATUS(stat) ((int)(((stat)>>8)&0xFF)) +#endif +void wait_process(pid_t pid, int *status) +{ + waitpid(pid, status, 0); + *status = WEXITSTATUS(*status); +}