]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: Fix virDaemonForkIntoBackground
authorJiri Denemark <jdenemar@redhat.com>
Thu, 16 Apr 2020 13:11:06 +0000 (15:11 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 17 Apr 2020 13:53:57 +0000 (15:53 +0200)
commit36e125296a53761deaa6cef04c306b10ca95a064
treed3fd52ed8f07cfd90b9a13578fec717824384b43
parente94ddeac0605ab0f4b45ef62a392c2eed5020330
util: Fix virDaemonForkIntoBackground

This commit partially reverts

    commit c360ea28dc267802690e129fbad08ca2f22a44e9
    Refs: v6.2.0-rc1-1-gc360ea28dc
    Author:     Rafael Fonseca <r4f4rfs@gmail.com>
    AuthorDate: Fri Mar 27 18:40:47 2020 +0100
    Commit:     Michal Prívozník <mprivozn@redhat.com>
    CommitDate: Mon Mar 30 09:48:22 2020 +0200

    util: virdaemon: fix compilation on mingw

    The daemons are not supported on Win32 and therefore were not compiled
    in that platform. However, with the daemon code sharing, all the code in
    utils *is* compiled and it failed because `waitpid`, `fork`, and
    `setsid` are not available. So, as before, let's not build them on
    Win32 and make the code more portable by using existing vir* wrappers.

Not compiling virDaemonForkIntoBackground on Win32 is good, but the
second part of the original patch incorrectly replaced waitpid and fork
with our virProcessWait and virFork APIs. These APIs are more than just
simple wrappers and we don't want any of the extra functionality.
Especially virFork would reset any setup made before
virDaemonForkIntoBackground is called, such as logging, signal handling,
etc.

As a result of the change the additional fix in v6.2.0-67-ga87e4788d2
(util: virdaemon: fix waiting for child processes) is no longer
needed and it is effectively reverted by this commit.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virdaemon.c