mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-18 10:04:20 +03:00
fix exit status; always print message on child failure
This commit is contained in:
parent
fcdf2e09a2
commit
919ab64fdb
@ -1558,22 +1558,19 @@ static void _daemonize(void)
|
|||||||
/* Problem with child. Determine what it is by exit code */
|
/* Problem with child. Determine what it is by exit code */
|
||||||
switch (WEXITSTATUS(child_status)) {
|
switch (WEXITSTATUS(child_status)) {
|
||||||
case EXIT_LOCKFILE_INUSE:
|
case EXIT_LOCKFILE_INUSE:
|
||||||
|
fprintf(stderr, "Another dmeventd daemon is already running\n");
|
||||||
break;
|
break;
|
||||||
case EXIT_DESC_CLOSE_FAILURE:
|
case EXIT_DESC_CLOSE_FAILURE:
|
||||||
break;
|
|
||||||
case EXIT_DESC_OPEN_FAILURE:
|
case EXIT_DESC_OPEN_FAILURE:
|
||||||
break;
|
|
||||||
case EXIT_OPEN_PID_FAILURE:
|
case EXIT_OPEN_PID_FAILURE:
|
||||||
break;
|
|
||||||
case EXIT_FIFO_FAILURE:
|
case EXIT_FIFO_FAILURE:
|
||||||
break;
|
|
||||||
case EXIT_CHDIR_FAILURE:
|
case EXIT_CHDIR_FAILURE:
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
|
fprintf(stderr, "Child exited with code %d\n", WEXITSTATUS(child_status));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit(child_status);
|
exit(WEXITSTATUS(child_status));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chdir("/"))
|
if (chdir("/"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user