about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--vlogger.c6
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);