]> xenbits.xensource.com Git - people/dstodden/blktap.git/commitdiff
CA-26523: Adjust blktapctrl exit status to main loop result.
authorDaniel Stodden <daniel.stodden@citrix.com>
Mon, 6 Apr 2009 20:22:21 +0000 (13:22 -0700)
committerDaniel Stodden <daniel.stodden@citrix.com>
Mon, 6 Apr 2009 20:22:21 +0000 (13:22 -0700)
In summary, this remains as unused as the prior code: the catch is
that we presently never exit voluntarily.

A watchdog parent + termination on signals, fatal conditions, etc,
would change the landscape. Especially since exiting with running
tapdisks is presently irrecoverable.

So for now just clean stuff up a little to prevent people from having
to investigate where all those return values go.

daemon/tapdisk-daemon.c

index 7f41efb14474befa6868e6eb36ef271e264ace03..e1595786464e2843b81b3a66ae033113ee74ee50 100644 (file)
@@ -672,19 +672,20 @@ main(int argc, char *argv[])
                goto out;
 
        err = tapdisk_daemon_start();
-       if (err)
+       if (err) {
+               EPRINTF("failed to start %s: %d\n", argv[0], err);
                goto out;
+       }
 
-       tapdisk_daemon_run();
+       err = tapdisk_daemon_run();
 
        tapdisk_daemon_stop();
+
        tapdisk_daemon_free();
 
-       err = 0;
 
 out:
-       if (err)
-               EPRINTF("failed to start %s: %d\n", argv[0], err);
        closelog();
-       return err;
+
+       return err ? 1 : 0;
 }