From bd1be70e0ef665bae2c28a4f877e4a5a8268de14 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 13 Jan 2015 11:54:28 -0800 Subject: 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 Reviewed-by: Oswald Buddenhagen --- src/3rdparty/forkfd/forkfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/3rdparty') diff --git a/src/3rdparty/forkfd/forkfd.c b/src/3rdparty/forkfd/forkfd.c index c4a670e1fc..84c979315f 100644 --- a/src/3rdparty/forkfd/forkfd.c +++ b/src/3rdparty/forkfd/forkfd.c @@ -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: -- cgit v1.2.3