diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2015-01-13 11:54:28 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2015-01-23 19:12:59 +0100 |
commit | bd1be70e0ef665bae2c28a4f877e4a5a8268de14 (patch) | |
tree | bccd5b002077e0c1a94f98e3d46964b1f8193d9c /src/3rdparty | |
parent | c8849dd8d587eca7aa59c5c865986f326c1e7c39 (diff) |
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>
Diffstat (limited to 'src/3rdparty')
-rw-r--r-- | src/3rdparty/forkfd/forkfd.c | 4 |
1 files changed, 2 insertions, 2 deletions
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: |