diff options
author | Roy Marples <roy@marples.name> | 2008-02-18 16:01:04 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2008-02-18 16:01:04 +0000 |
commit | b0442b31935caf87f0dc2d6679b4e106414513ed (patch) | |
tree | dd283d3fcbd7304eff474ad415d8aa9089825369 | |
parent | d904acf448ed12b8ae0f3423e7ee4f4a146a3710 (diff) |
We need to check for contents of argv too.
-rw-r--r-- | src/librc/librc-daemon.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c index 02f217e2..fab3415b 100644 --- a/src/librc/librc-daemon.c +++ b/src/librc/librc-daemon.c @@ -351,7 +351,7 @@ bool rc_service_daemon_set (const char *service, const char *const *argv, DIR *dp; struct dirent *d; - if (! argv && ! name && ! pidfile) { + if (! (argv && *argv) && ! name && ! pidfile) { errno = EINVAL; return (false); } @@ -359,7 +359,7 @@ bool rc_service_daemon_set (const char *service, const char *const *argv, dirpath = rc_strcatpaths (RC_SVCDIR, "daemons", basename_c (service), (char *) NULL); - if (argv) { + if (argv && *argv) { l = strlen (*argv) + 6; mexec = xmalloc (sizeof (char) * l); snprintf (mexec, l, "exec=%s", *argv); |