summaryrefslogtreecommitdiffstats
path: root/vl.c
diff options
context:
space:
mode:
authorMichael Tokarev2014-10-30 15:40:48 +0100
committerMichael Tokarev2014-11-02 08:04:34 +0100
commitfee78fd6d2f8dfdfd447a33c34323dd5bd3193a2 (patch)
tree612837d9d5e1c36af4a6fbbe3a007c4ca17ff50b /vl.c
parentos-posix: replace goto again with a proper loop (diff)
downloadqemu-fee78fd6d2f8dfdfd447a33c34323dd5bd3193a2.tar.gz
qemu-fee78fd6d2f8dfdfd447a33c34323dd5bd3193a2.tar.xz
qemu-fee78fd6d2f8dfdfd447a33c34323dd5bd3193a2.zip
pidfile: stop making pidfile error a special case
In case of -daemonize, we write non-zero to the daemon pipe only if pidfile creation failed, so the parent will report error about pidfile problem. There's no need to make special case for this, since all other errors are reported by the child just fine. Let the parent report error and simplify logic in os_daemonize(). This way, we don't need os_pidfile_error() function, since it only prints error now, so put the error reporting printf into the only place where qemu_create_pidfile() is called, in vl.c. While at it, fix wrong indentation in os_daemonize(). Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vl.c b/vl.c
index f6b3546942..150524c718 100644
--- a/vl.c
+++ b/vl.c
@@ -3999,7 +3999,7 @@ int main(int argc, char **argv, char **envp)
#endif
if (pid_file && qemu_create_pidfile(pid_file) != 0) {
- os_pidfile_error();
+ fprintf(stderr, "Could not acquire pid file: %s\n", strerror(errno));
exit(1);
}