PKGBUILDs/core/klibc/kinit-fix-init-cmdline.patch

30 lines
914 B
Diff

diff -Nur klibc-1.5.15.orig/usr/kinit/kinit.c klibc-1.5.15/usr/kinit/kinit.c
--- klibc-1.5.15.orig/usr/kinit/kinit.c 2009-01-04 20:28:03.000000000 +0100
+++ klibc-1.5.15/usr/kinit/kinit.c 2009-06-07 12:55:38.643000948 +0200
@@ -191,7 +191,6 @@
/* This is the argc and argv we pass to init */
const char *init_path;
-int init_argc;
char **init_argv;
extern ssize_t readfile(const char *, char **);
@@ -211,7 +210,6 @@
srand48(now.tv_usec ^ (now.tv_sec << 24));
/* Default parameters for anything init-like we execute */
- init_argc = argc;
init_argv = alloca((argc+1)*sizeof(char *));
memcpy(init_argv, argv, (argc+1)*sizeof(char *));
@@ -258,7 +256,8 @@
/* Find an -- argument, and if so append to the command line */
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "--")) {
- i++;
+ /* The -- marks the end of init's command line */
+ init_argv[i++] = NULL;
break;
}
}