mirror of
https://github.com/troglobit/finit.git
synced 2026-11-13 17:00:16 +00:00
API: Check input argument
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
9f62153966
commit
f7cd46abc9
1 file changed
+10
@@ -116,6 +116,9 @@ static int call(int (*action)(svc_t *), char *buf, size_t len)
|
|||||||
|
|
||||||
static int service_block(svc_t *svc)
|
static int service_block(svc_t *svc)
|
||||||
{
|
{
|
||||||
|
if (!svc)
|
||||||
|
return 1;
|
||||||
|
|
||||||
svc_block(svc);
|
svc_block(svc);
|
||||||
service_step(svc);
|
service_step(svc);
|
||||||
|
|
||||||
@@ -124,6 +127,9 @@ static int service_block(svc_t *svc)
|
|||||||
|
|
||||||
static int service_unblock(svc_t *svc)
|
static int service_unblock(svc_t *svc)
|
||||||
{
|
{
|
||||||
|
if (!svc)
|
||||||
|
return 1;
|
||||||
|
|
||||||
svc_unblock(svc);
|
svc_unblock(svc);
|
||||||
service_step(svc);
|
service_step(svc);
|
||||||
|
|
||||||
@@ -132,8 +138,12 @@ static int service_unblock(svc_t *svc)
|
|||||||
|
|
||||||
static int service_restart(svc_t *svc)
|
static int service_restart(svc_t *svc)
|
||||||
{
|
{
|
||||||
|
if (!svc)
|
||||||
|
return 1;
|
||||||
|
|
||||||
svc_mark_dirty(svc);
|
svc_mark_dirty(svc);
|
||||||
service_step(svc);
|
service_step(svc);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user