diff options
author | Duncaen <mail@duncano.de> | 2017-04-05 17:10:32 +0200 |
---|---|---|
committer | Duncaen <mail@duncano.de> | 2018-06-20 18:02:46 +0200 |
commit | ffa76819288ae458b10adb7b5bafc5855508b8be (patch) | |
tree | 09289c613b41a86d6b77ee03eae9edfd606bbec5 | |
parent | b9759b70a179b72b98413925061d94996562f633 (diff) | |
download | runit-void-ffa76819288ae458b10adb7b5bafc5855508b8be.tar.gz runit-void-ffa76819288ae458b10adb7b5bafc5855508b8be.tar.xz runit-void-ffa76819288ae458b10adb7b5bafc5855508b8be.zip |
vlogger: run /etc/vlogger with the same argv[0]
-rw-r--r-- | vlogger.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vlogger.c b/vlogger.c index 00f471a..4932408 100644 --- a/vlogger.c +++ b/vlogger.c @@ -74,10 +74,12 @@ strpriority(char *s, int *facility, int *level) int main(int argc, char *argv[]) { - char c, *p; + char c, *p, *argv0; int facility = LOG_DAEMON; int level = LOG_INFO; + argv0 = *argv; + if (((p = strrchr(*argv, '/')) && !strncmp(p+1, "run", 3)) && (*p = 0, (p = strrchr(*argv, '/')) && !strncmp(p+1, "log", 3)) && (*p = 0, (p = strrchr(*argv, '/'))) != 0) { @@ -94,7 +96,7 @@ main(int argc, char *argv[]) } if (access("/etc/vlogger", X_OK) != -1) - execl("/etc/vlogger", "/etc/vlogger", tag, (char *)0); + execl("/etc/vlogger", argv0, tag, (char *)0); openlog(tag, 0, facility); |