Show help if we don't have any args, Gentoo #198380.

This commit is contained in:
Roy Marples
2007-11-14 16:19:56 +00:00
parent a8f4032d29
commit 69a040bf85
2 changed files with 10 additions and 5 deletions

View File

@ -990,10 +990,17 @@ int runscript (int argc, char **argv)
int opt;
char *svc;
/* Show help if insufficient args */
if (argc < 2) {
execl (RCSCRIPT_HELP, RCSCRIPT_HELP, (char *) NULL);
eerrorx ("%s: failed to exec `" RCSCRIPT_HELP "': %s", argv[0],
strerror (errno));
}
/* We need the full path to the service */
if (! realpath (argv[0], service))
if (! realpath (argv[1], service))
eerrorx ("unable to resolve the path `%s': %s",
argv[0], strerror (errno));
argv[1], strerror (errno));
applet = xstrdup (basename (service));
atexit (cleanup);