summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-08-16 17:09:57 +0000
committerRoy Marples <roy@marples.name>2007-08-16 17:09:57 +0000
commiteba9b8ac144aaf86d6e5a80e48ccd70ae9515962 (patch)
treef19168f4df796fa770e1541913b4d0ea36e0dd90 /src
parent6e5c8f8e5a02f624f2f8dd7d0b639d54e2993498 (diff)
downloadopenrc-eba9b8ac144aaf86d6e5a80e48ccd70ae9515962.tar.gz
openrc-eba9b8ac144aaf86d6e5a80e48ccd70ae9515962.tar.bz2
openrc-eba9b8ac144aaf86d6e5a80e48ccd70ae9515962.tar.xz
Fully move esyslog into rc
Diffstat (limited to 'src')
-rw-r--r--src/rc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/rc.c b/src/rc.c
index ad47378..1824e05 100644
--- a/src/rc.c
+++ b/src/rc.c
@@ -172,12 +172,18 @@ static int do_e (int argc, char **argv)
char *dot = strchr (argv[0], '.');
if ((level = syslog_decode (dot + 1, prioritynames)) == -1)
eerrorx ("%s: invalid log level `%s'", applet, argv[0]);
- argc--;
- argv++;
+
+ if (argc < 3)
+ eerrorx ("%s: not enough arguments", applet);
+
+ unsetenv ("RC_ELOG");
+ setenv ("RC_ELOG", argv[1], 1);
+
+ argc -= 2;
+ argv += 2;
}
}
-
if (argc > 0) {
for (i = 0; i < argc; i++)
l += strlen (argv[i]) + 1;