From b0442b31935caf87f0dc2d6679b4e106414513ed Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 18 Feb 2008 16:01:04 +0000 Subject: We need to check for contents of argv too. --- src/librc/librc-daemon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/librc') 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); -- cgit v1.2.3