mirror of
https://github.com/troglobit/finit.git
synced 2026-11-09 16:21:24 +00:00
Minor refactor
- Check all pointers - Declaratons always at top of func/scope - Use established variable nomenclature - Skip useless if() stmt Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
85b29d9407
commit
49bd63994c
1 file changed
+5
-9
@@ -116,17 +116,13 @@ static int do_reload (char *buf, size_t len) { return call(reload, buf, len); }
|
|||||||
|
|
||||||
static int do_signal_svc(svc_t *svc, void *user_data)
|
static int do_signal_svc(svc_t *svc, void *user_data)
|
||||||
{
|
{
|
||||||
if (!svc)
|
int signo;
|
||||||
|
|
||||||
|
if (!svc || !user_data || !svc_is_running(svc))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (!svc_is_running(svc))
|
signo = *(int *)user_data;
|
||||||
return 1;
|
return !!kill(svc->pid, signo);
|
||||||
|
|
||||||
int sig = *(int *)user_data;
|
|
||||||
if (kill(svc->pid, sig))
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int do_signal(char *buf, size_t len, int sig)
|
static int do_signal(char *buf, size_t len, int sig)
|
||||||
|
|||||||
Reference in new issue
Block a user