From eba9b8ac144aaf86d6e5a80e48ccd70ae9515962 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 16 Aug 2007 17:09:57 +0000 Subject: Fully move esyslog into rc --- src/rc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/rc.c') diff --git a/src/rc.c b/src/rc.c index ad47378e..1824e058 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; -- cgit v1.2.3