render / rpms / libvirt

Forked from rpms/libvirt 11 months ago
Clone
Daniel P. Berrange 81e46c
diff -rup libvirt-0.4.1.orig/qemud/qemud.c libvirt-0.4.1.new/qemud/qemud.c
Daniel P. Berrange 81e46c
--- libvirt-0.4.1.orig/qemud/qemud.c	2008-03-10 17:31:09.000000000 -0400
Daniel P. Berrange 81e46c
+++ libvirt-0.4.1.new/qemud/qemud.c	2008-03-10 17:31:36.000000000 -0400
Daniel P. Berrange 81e46c
@@ -393,7 +393,7 @@ static int qemudGoDaemon(void) {
Daniel P. Berrange 81e46c
             case -1:
Daniel P. Berrange 81e46c
                 return -1;
Daniel P. Berrange 81e46c
             default:
Daniel P. Berrange 81e46c
-                return nextpid;
Daniel P. Berrange 81e46c
+                _exit(0);
Daniel P. Berrange 81e46c
             }
Daniel P. Berrange 81e46c
 
Daniel P. Berrange 81e46c
         cleanup:
Daniel P. Berrange 81e46c
@@ -418,8 +418,7 @@ static int qemudGoDaemon(void) {
Daniel P. Berrange 81e46c
                 status != 0) {
Daniel P. Berrange 81e46c
                 return -1;
Daniel P. Berrange 81e46c
             }
Daniel P. Berrange 81e46c
-
Daniel P. Berrange 81e46c
-            return pid;
Daniel P. Berrange 81e46c
+            _exit(0);
Daniel P. Berrange 81e46c
         }
Daniel P. Berrange 81e46c
     }
Daniel P. Berrange 81e46c
 }
Daniel P. Berrange 81e46c
@@ -2116,16 +2115,12 @@ int main(int argc, char **argv) {
Daniel P. Berrange 81e46c
         goto error1;
Daniel P. Berrange 81e46c
 
Daniel P. Berrange 81e46c
     if (godaemon) {
Daniel P. Berrange 81e46c
-        int pid;
Daniel P. Berrange 81e46c
         openlog("libvirtd", 0, 0);
Daniel P. Berrange 81e46c
-        pid = qemudGoDaemon();
Daniel P. Berrange 81e46c
-        if (pid < 0) {
Daniel P. Berrange 81e46c
+        if (qemudGoDaemon() < 0) {
Daniel P. Berrange 81e46c
             qemudLog(QEMUD_ERR, _("Failed to fork as daemon: %s"),
Daniel P. Berrange 81e46c
                      strerror(errno));
Daniel P. Berrange 81e46c
             goto error1;
Daniel P. Berrange 81e46c
         }
Daniel P. Berrange 81e46c
-        if (pid > 0)
Daniel P. Berrange 81e46c
-            goto out;
Daniel P. Berrange 81e46c
 
Daniel P. Berrange 81e46c
         /* Choose the name of the PID file. */
Daniel P. Berrange 81e46c
         if (!pid_file) {
Daniel P. Berrange 81e46c
@@ -2172,7 +2167,6 @@ int main(int argc, char **argv) {
Daniel P. Berrange 81e46c
     if (godaemon)
Daniel P. Berrange 81e46c
         closelog();
Daniel P. Berrange 81e46c
 
Daniel P. Berrange 81e46c
- out:
Daniel P. Berrange 81e46c
     ret = 0;
Daniel P. Berrange 81e46c
 
Daniel P. Berrange 81e46c
  error2: