[Libguestfs] [PATCH] Add safe wrapper around waitpid which deals with EINTR correctly.

Richard W.M. Jones rjones at redhat.com
Thu Apr 14 17:26:48 UTC 2016


As Eric Blake noted in:
https://www.redhat.com/archives/libguestfs/2016-April/msg00154.html
libguestfs doesn't correctly handle the case where waitpid receives a
SIGCHLD signal and the main program has registered a non-restartable
signal handler.

In this case waitpid would return -EINTR and we would print an error,
but actually we should retry this case.

This adds two new internal functions, one for handling waitpid and
printing (real) errors from it, the other for just waiting for a
process where we don't particularly care about errors.

Rich.




More information about the Libguestfs mailing list