Fix compilation of non-waittid forkfd() outside of Linux
POSIX.1 does not guarantee the presence of the si_utime and si_stime members. So instead of trying to set those members to zero, ask the compiler to initialize everything for us. This was found on OS X when HAVE_WAITTID was removed. forkfd.c:192:11: error: no member named 'si_utime' in '__siginfo' forkfd.c:193:11: error: no member named 'si_stime' in '__siginfo' Change-Id: Ic5d393bfd36e48a193fcffff13b90aa6ccf592ae Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>bb10
parent
c8849dd8d5
commit
bd1be70e0e
|
|
@ -181,8 +181,6 @@ static int tryReaping(pid_t pid, siginfo_t *info)
|
|||
return 0; // child did not change state
|
||||
|
||||
info->si_signo = SIGCHLD;
|
||||
info->si_utime = 0;
|
||||
info->si_stime = 0;
|
||||
info->si_pid = pid;
|
||||
if (WIFEXITED(status)) {
|
||||
info->si_code = CLD_EXITED;
|
||||
|
|
@ -234,6 +232,8 @@ static void sigchld_handler(int signum)
|
|||
siginfo_t info;
|
||||
int i;
|
||||
|
||||
memset(&info, 0, sizeof info);
|
||||
|
||||
#ifdef HAVE_WAITID
|
||||
/* be optimistic: try to see if we can get the child that exited */
|
||||
search_next_child:
|
||||
|
|
|
|||
Loading…
Reference in New Issue