mirror of
https://github.com/troglobit/finit.git
synced 2026-11-06 15:51:03 +00:00
Simplify execution and _exit() of service callback.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
9796809907
commit
48b420b757
1 file changed
+2
-4
@@ -113,10 +113,8 @@ svc_cmd_t service_enabled(svc_t *svc, int event, void *arg)
|
|||||||
return SVC_STOP;
|
return SVC_STOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pid) {
|
if (!pid)
|
||||||
status = svc->cb(svc, event, arg);
|
_exit(svc->cb(svc, event, arg));
|
||||||
exit(status);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (waitpid(pid, &status, 0) == -1) {
|
if (waitpid(pid, &status, 0) == -1) {
|
||||||
_pe("Failed reading status from %s callback", svc->cmd);
|
_pe("Failed reading status from %s callback", svc->cmd);
|
||||||
|
|||||||
Reference in new issue
Block a user