mirror of
https://github.com/troglobit/finit.git
synced 2026-10-28 12:30:44 +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;
|
||||
}
|
||||
|
||||
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