We need to check for contents of argv too.

This commit is contained in:
Roy Marples 2008-02-18 16:01:04 +00:00
parent d904acf448
commit b0442b3193

View File

@ -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);