Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142536672
D28240.id82677.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
794 B
Referenced Files
None
Subscribers
None
D28240.id82677.diff
View Options
diff --git a/bin/pwait/pwait.1 b/bin/pwait/pwait.1
--- a/bin/pwait/pwait.1
+++ b/bin/pwait/pwait.1
@@ -32,7 +32,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 5, 2020
+.Dd January 21, 2021
.Dt PWAIT 1
.Os
.Sh NAME
@@ -145,6 +145,10 @@
.Xr wait 1
builtin
as it will not clean up any zombies or state in the parent process.
+.Pp
+To avoid deadlock,
+.Nm
+will ignore its own pid, if it is provided as a process id to wait for.
.Sh HISTORY
A
.Nm
diff --git a/bin/pwait/pwait.c b/bin/pwait/pwait.c
--- a/bin/pwait/pwait.c
+++ b/bin/pwait/pwait.c
@@ -146,6 +146,10 @@
warnx("%s: bad process id", s);
continue;
}
+ if (pid == getpid()) {
+ warnx("%s: skiping my own pid", s);
+ continue;
+ }
for (i = 0; i < nleft; i++) {
if (e[i].ident == (uintptr_t)pid) {
break;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 21, 6:04 PM (47 m, 10 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27815926
Default Alt Text
D28240.id82677.diff (794 B)
Attached To
Mode
D28240: Remove deadlock in rc caused by pwait waiting for itself
Attached
Detach File
Event Timeline
Log In to Comment