From fee78fd6d2f8dfdfd447a33c34323dd5bd3193a2 Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Thu, 30 Oct 2014 17:40:48 +0300 Subject: 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 --- vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vl.c') 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); } -- cgit v1.2.1