mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 13:33:09 +07:00
Simplify execution and _exit() of service callback.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -113,10 +113,8 @@ svc_cmd_t service_enabled(svc_t *svc, int event, void *arg)
|
||||
return SVC_STOP;
|
||||
}
|
||||
|
||||
if (!pid) {
|
||||
status = svc->cb(svc, event, arg);
|
||||
exit(status);
|
||||
}
|
||||
if (!pid)
|
||||
_exit(svc->cb(svc, event, arg));
|
||||
|
||||
if (waitpid(pid, &status, 0) == -1) {
|
||||
_pe("Failed reading status from %s callback", svc->cmd);
|
||||
|
||||
Reference in New Issue
Block a user