]> xenbits.xensource.com Git - libvirt.git/commit
util: virdaemon: fix waiting for child processes
authorRafael Fonseca <r4f4rfs@gmail.com>
Wed, 8 Apr 2020 12:12:54 +0000 (14:12 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 8 Apr 2020 12:40:47 +0000 (14:40 +0200)
commita87e4788d2ee3d74cef5679d2961689d4e4a96a3
tree489385d04900daaacbf5b3ccc084064b96d81f3d
parent4df7280bd57e222c2213f548b7acb98980ae0e79
util: virdaemon: fix waiting for child processes

Unlike `waitpid`, `virProcessWait` only returns -1 (error) or 0
(success), so comparing that to `pid` will always be false and the
parent will report failure with:

error : main:851 : Failed to fork as daemon: No such file or directory

even though the grandchild process is succesfully running. Note that the
errno message is misleading: it was last set when trying to find a
restart state file.

Signed-off-by: Rafael Fonseca <r4f4rfs@gmail.com>
Reported-by: Marcin Krol <hawk@tld-linux.org>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/util/virdaemon.c