about summary refs log tree commit diff
path: root/src/process/execle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/process/execle.c')
-rw-r--r--src/process/execle.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/process/execle.c b/src/process/execle.c
index 37f629d9..64908366 100644
--- a/src/process/execle.c
+++ b/src/process/execle.c
@@ -1,19 +1,20 @@
 #include <unistd.h>
 #include <stdarg.h>
 
-int execle(const char *path, ...)
+int execle(const char *path, const char *argv0, ...)
 {
 	int argc;
 	va_list ap;
-	va_start(ap, path);
-	for (argc=0; va_arg(ap, const char *); argc++);
+	va_start(ap, argv0);
+	for (argc=1; va_arg(ap, const char *); argc++);
 	va_end(ap);
 	{
 		int i;
 		char *argv[argc+1];
 		char **envp;
-		va_start(ap, path);
-		for (i=0; i<argc; i++)
+		va_start(ap, argv0);
+		argv[0] = (char *)argv0;
+		for (i=1; i<argc; i++)
 			argv[i] = va_arg(ap, char *);
 		argv[i] = NULL;
 		envp = va_arg(ap, char **);