Page MenuHomeFreeBSD

D12414.id33652.diff
No OneTemporary

D12414.id33652.diff

Index: bin/ps/ps.c
===================================================================
--- bin/ps/ps.c
+++ bin/ps/ps.c
@@ -523,7 +523,11 @@
*/
nentries = -1;
kp = kvm_getprocs(kd, what, flag, &nentries);
- if ((kp == NULL && nentries > 0) || (kp != NULL && nentries < 0))
+ /*
+ * Ignore ESRCH to preserve behaviour of "ps -p nonexistent-pid"
+ * not reporting an error.
+ */
+ if ((kp == NULL && errno != ESRCH) || (kp != NULL && nentries < 0))
xo_errx(1, "%s", kvm_geterr(kd));
nkept = 0;
if (nentries > 0) {

File Metadata

Mime Type
text/plain
Expires
Sun, May 3, 12:45 AM (5 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32635278
Default Alt Text
D12414.id33652.diff (528 B)

Event Timeline