Browse Source

Use WEXITSTATUS to retrieve the termination status

Thanks to "neologix" from linuxfr.org.
develop
Damien Goutte-Gattat 9 years ago
parent
commit
d9dbe93719
  1. 3
      src/wait4pid.c

3
src/wait4pid.c

@ -26,6 +26,7 @@
#include <unistd.h>
#include <signal.h>
#include <sys/socket.h>
#include <sys/wait.h> /* for WEXITSTATUS */
#include <linux/netlink.h>
#include <linux/connector.h>
#include <linux/cn_proc.h>
@ -146,7 +147,7 @@ wait4all(pid_t *pids, size_t len)
pids[i] = -1;
nproc -= 1;
if ( i == len - 1 )
ec = payload->evt.event_data.exit.exit_code / 256;
ec = WEXITSTATUS(payload->evt.event_data.exit.exit_code);
}
}
}

Loading…
Cancel
Save