qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/3] Fix -daemonize option


From: Anthony Liguori
Subject: [Qemu-devel] [PATCH 3/3] Fix -daemonize option
Date: Tue, 22 Jul 2008 15:51:43 -0500

When using -daemonize, we want to avoid chdir() until after we've opened the
block devices.  It's also perfectly fine to use -dameonize along with SDL.

Signed-off-by: Anthony Liguori <address@hidden>

diff --git a/vl.c b/vl.c
index f057a5e..d94ebb1 100644
--- a/vl.c
+++ b/vl.c
@@ -8626,11 +8626,6 @@ int main(int argc, char **argv)
     }
 
 #ifndef _WIN32
-    if (daemonize && !nographic && vnc_display == NULL) {
-       fprintf(stderr, "Can only daemonize if using -nographic or -vnc\n");
-       daemonize = 0;
-    }
-
     if (daemonize) {
        pid_t pid;
 
@@ -8668,7 +8663,6 @@ int main(int argc, char **argv)
            exit(1);
 
        umask(027);
-       chdir("/");
 
         signal(SIGTSTP, SIG_IGN);
         signal(SIGTTOU, SIG_IGN);
@@ -8974,6 +8968,7 @@ int main(int argc, char **argv)
        if (len != 1)
            exit(1);
 
+       chdir("/");
        TFR(fd = open("/dev/null", O_RDWR));
        if (fd == -1)
            exit(1);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]