diff options
| author | Roy Marples <roy@marples.name> | 2007-11-14 16:19:56 +0000 | 
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2007-11-14 16:19:56 +0000 | 
| commit | 69a040bf85e59043dbc6dbb9f67260ed91a93cd5 (patch) | |
| tree | 3cb1b1923c340ea5f41c506271d64023ab6c01f8 /src | |
| parent | a8f4032d292afb80ec1dddde3c61845c2c298ad3 (diff) | |
| download | openrc-69a040bf85e59043dbc6dbb9f67260ed91a93cd5.tar.xz | |
Show help if we don't have any args, Gentoo #198380.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile | 4 | ||||
| -rw-r--r-- | src/runscript.c | 11 | 
2 files changed, 10 insertions, 5 deletions
diff --git a/src/Makefile b/src/Makefile index 571a48eb..51806056 100644 --- a/src/Makefile +++ b/src/Makefile @@ -95,9 +95,7 @@ CPPFLAGS += -DLIB=\"$(LIB)\"  # IMPORTANT!!!  # Ensure that we don't ship with a .svn directory to avoid RPATH security  # issues. However, this does ease development a little -_SVN_LDFLAGS_SH = if test -d .svn; then echo "-Wl,-rpath ."; else echo ""; fi -_SVN_LDFLAGS != $(_SVN_LDFLAGS_SH) -LDFLAGS += $(_SVN_LDFLAGS)$(shell $(_SVN_LDFLAGS_SH)) +LDFLAGS += -Wl,-rpath .  # Load an optional OS Makefile  _OS_SH = u=`uname -s`; case "$${u}" in *BSD|DragonFly) echo "BSD";; *) echo "$${u}";; esac diff --git a/src/runscript.c b/src/runscript.c index 63453374..7bdde764 100644 --- a/src/runscript.c +++ b/src/runscript.c @@ -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);  | 
