Page MenuHomeFreeBSD

D12414.id33757.diff
No OneTemporary

D12414.id33757.diff

Index: head/bin/ps/ps.c
===================================================================
--- head/bin/ps/ps.c
+++ head/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
Mon, Apr 13, 12:45 PM (9 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31410601
Default Alt Text
D12414.id33757.diff (543 B)

Event Timeline