Bug#714222: libstoragemgmt: FTBFS on non-Linux: 'WEXITED' undeclared

dEbian Bugs RC

Source: libstoragemgmt
Version: 0.0.20-1
Severity: serious
Justification: fails to build from source

Builds of libstoragemgmt on the Hurd and kFreeBSD have been failing
because WEXITED is evidently Linux-specific:

CC lsm_daemon.o
lsm_daemon.c: In function 'child_cleanup':

rc = waitid(P_ALL, 0, &si, WNOHANG|WEXITED);
^


Could you please take a look?

Thanks!
Use plain waitpid() instead, it suffices for code needs.
Moreover, I guess that killed child should be logged too.

Petr

--- src/lsm_daemon.c
+++ src/lsm_daemon.c
@@ -420,14 +420,13 @@
int rc;

do {
- siginfo_t si;
- memset(&si, 0, sizeof(siginfo_t));
+ int status;

- rc = waitid(P_ALL, 0, &si, WNOHANG|WEXITED);
+ rc = waitpid(-1, &status, WNOHANG);

if( rc > 0 ) {
- if( si.si_code == CLD_EXITED && si.si_status != 0 ) {
- info("Plug-in process %d exited with %d\n", rc, si.si_status);
+ if( !WIFEXITED(status) || (WEXITSTATUS(status) != 0 )) {
+ info("Plug-in process %d exited with %d\n", rc, status);
}
} else {
break;