aboutsummaryrefslogtreecommitdiff
path: root/libshouldbeinlibc
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2022-01-04 16:27:03 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-01-04 16:27:03 +0100
commitad63bae03cf0eb9edced3803cbcd0cee02377050 (patch)
tree0a3d77d2e081c33f7387ae18fb56e799d9771b4e /libshouldbeinlibc
parent6bbb65d6885eba9ac380757515a21ae9cca62727 (diff)
downloadhurd-ad63bae03cf0eb9edced3803cbcd0cee02377050.tar.gz
hurd-ad63bae03cf0eb9edced3803cbcd0cee02377050.tar.bz2
hurd-ad63bae03cf0eb9edced3803cbcd0cee02377050.zip
portinfo: Do not compare port to anything when it is MACH_PORT_DEAD
Otherwise it would successfully compare to any port that happens to be MACH_PORT_DEAD, e.g. the bootstrap port.
Diffstat (limited to 'libshouldbeinlibc')
-rw-r--r--libshouldbeinlibc/portinfo.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libshouldbeinlibc/portinfo.c b/libshouldbeinlibc/portinfo.c
index de087de9..a023446a 100644
--- a/libshouldbeinlibc/portinfo.c
+++ b/libshouldbeinlibc/portinfo.c
@@ -119,7 +119,10 @@ print_port_info (mach_port_t name, mach_port_type_t type, task_t task,
mach_port_t msgport;
pid_t pid;
- err = proc_task2pid (proc, task, &pid);
+ if (port == MACH_PORT_DEAD)
+ err = EIEIO;
+ else
+ err = proc_task2pid (proc, task, &pid);
if (!err)
err = proc_getmsgport (proc, pid, &msgport);
if (!err)