mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 02:51:16 +00:00
Don't run cleannup code for parent process in daemon mode
This commit is contained in:
parent
f5ade63437
commit
028e4a6116
@ -1,3 +1,8 @@
|
|||||||
|
Tue Mar 11 10:17:53 EDT 2008 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
|
* qemud/qemud.c: Don't run cleanup code when parent process is
|
||||||
|
exiting in daemon mode.
|
||||||
|
|
||||||
Fri Mar 7 12:11:53 CET 2008 Daniel Veillard <veillard@redhat.com>
|
Fri Mar 7 12:11:53 CET 2008 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
* docs/libvir.html docs/storage.html: apply documentation fixes
|
* docs/libvir.html docs/storage.html: apply documentation fixes
|
||||||
|
@ -393,7 +393,7 @@ static int qemudGoDaemon(void) {
|
|||||||
case -1:
|
case -1:
|
||||||
return -1;
|
return -1;
|
||||||
default:
|
default:
|
||||||
return nextpid;
|
_exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
@ -418,8 +418,7 @@ static int qemudGoDaemon(void) {
|
|||||||
status != 0) {
|
status != 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
_exit(0);
|
||||||
return pid;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2116,16 +2115,12 @@ int main(int argc, char **argv) {
|
|||||||
goto error1;
|
goto error1;
|
||||||
|
|
||||||
if (godaemon) {
|
if (godaemon) {
|
||||||
int pid;
|
|
||||||
openlog("libvirtd", 0, 0);
|
openlog("libvirtd", 0, 0);
|
||||||
pid = qemudGoDaemon();
|
if (qemudGoDaemon() < 0) {
|
||||||
if (pid < 0) {
|
|
||||||
qemudLog(QEMUD_ERR, _("Failed to fork as daemon: %s"),
|
qemudLog(QEMUD_ERR, _("Failed to fork as daemon: %s"),
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
goto error1;
|
goto error1;
|
||||||
}
|
}
|
||||||
if (pid > 0)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
/* Choose the name of the PID file. */
|
/* Choose the name of the PID file. */
|
||||||
if (!pid_file) {
|
if (!pid_file) {
|
||||||
@ -2172,7 +2167,6 @@ int main(int argc, char **argv) {
|
|||||||
if (godaemon)
|
if (godaemon)
|
||||||
closelog();
|
closelog();
|
||||||
|
|
||||||
out:
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
error2:
|
error2:
|
||||||
|
Loading…
Reference in New Issue
Block a user