summaryrefslogtreecommitdiff
path: root/startup
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2021-07-11 11:20:42 +1000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2021-07-11 19:42:25 +0200
commit967fc183fd27607fe0f58af36801793725c7c558 (patch)
tree92ac6a2e6d0b6debbc4f53fa2c5e6196677f0f7e /startup
parentd9f93a335f230fe018747c075734646db70bdb7a (diff)
Fix /proc/?/exe values for bootstrap processes
This makes libmachdev follow the exec case, and make sure to be waiting for all bootstrap processes by waiting for the FS process. Message-Id: <20210711012042.77920-1-damien@zamaudio.com>
Diffstat (limited to 'startup')
-rw-r--r--startup/startup.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/startup/startup.c b/startup/startup.c
index 9faeb462..90cdaa85 100644
--- a/startup/startup.c
+++ b/startup/startup.c
@@ -1462,7 +1462,7 @@ S_startup_essential_task (mach_port_t server,
char *name,
mach_port_t credential)
{
- static int authinit, procinit, execinit;
+ static int authinit, procinit, execinit, fsinit;
int fail;
/* Always deallocate the extra reference this message carries. */
@@ -1494,11 +1494,21 @@ S_startup_essential_task (mach_port_t server,
}
else if (!strcmp (name, "proc"))
procinit = 1;
+ else if (!strcmp (name, "ext2fs"))
+ fsinit = 1;
+ else
+ {
+ mach_port_t otherproc;
+ proc_child (procserver, task);
+ proc_task2proc (procserver, task, &otherproc);
+ proc_mark_important (otherproc);
+ proc_set_exe (otherproc, name);
+ }
if (verbose)
fprintf (stderr, " still waiting for:");
- if (authinit && execinit && procinit)
+ if (authinit && execinit && procinit && fsinit)
{
if (verbose)
fprintf (stderr, " none!\n");
@@ -1524,6 +1534,8 @@ S_startup_essential_task (mach_port_t server,
fprintf (stderr, " exec");
if (! procinit)
fprintf (stderr, " proc");
+ if (! fsinit)
+ fprintf (stderr, " fs");
fprintf (stderr, "\n");
}
}