2009-03-27 00:43:28 +01:00
|
|
|
--- startpar.c 2009-03-25 16:52:25.357391610 +0100
|
|
|
|
+++ startpar.c 2009-03-25 21:22:50.145032810 +0100
|
|
|
|
@@ -368,6 +368,7 @@
|
|
|
|
if (!strcmp(arg, "start"))
|
|
|
|
{
|
|
|
|
int s, t, len;
|
|
|
|
+ pid_t child;
|
|
|
|
struct sockaddr_un remote;
|
|
|
|
char str[100];
|
|
|
|
|
|
|
|
@@ -397,6 +398,20 @@
|
|
|
|
kill(parent, SIGUSR2);
|
|
|
|
}
|
|
|
|
close(s);
|
2009-04-01 18:20:36 +02:00
|
|
|
+ /*
|
|
|
|
+ * if we use preload, we fork again to make bootcharts easier to read.
|
|
|
|
+ * The reason is that the name of the init script will otherwise be used
|
|
|
|
+ * when in reality the above code waited for preload. If we fork away
|
|
|
|
+ * before the exec, the waiting code will be folded into startpar
|
|
|
|
+ */
|
2009-03-27 00:43:28 +01:00
|
|
|
+ child = fork();
|
2009-04-01 18:20:36 +02:00
|
|
|
+ if (child) {
|
2009-03-27 00:43:28 +01:00
|
|
|
+ int status;
|
|
|
|
+ int ret = waitpid(child, &status, 0);
|
|
|
|
+ if (ret == -1)
|
|
|
|
+ perror("waitpid");
|
|
|
|
+ exit(WEXITSTATUS(status));
|
2009-04-01 18:20:36 +02:00
|
|
|
+ }
|
2009-03-27 00:43:28 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|