Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177824213
D57493.1795367906.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
868 B
Referenced Files
None
Subscribers
None
D57493.1795367906.diff
View Options
diff --git a/usr.bin/procstat/procstat_bin.c b/usr.bin/procstat/procstat_bin.c
--- a/usr.bin/procstat/procstat_bin.c
+++ b/usr.bin/procstat/procstat_bin.c
@@ -35,6 +35,7 @@
#include <errno.h>
#include <libprocstat.h>
#include <limits.h>
+#include <signal.h>
#include <stdio.h>
#include <string.h>
@@ -50,12 +51,13 @@
xo_emit("{T:/%5s %-16s %8s %s}\n", "PID", "COMM", "OSREL",
"PATH");
- if (procstat_getpathname(prstat, kipp, pathname, sizeof(pathname)) != 0)
+ if (kill(kipp->ki_pid, 0) == -1)
return;
- if (strlen(pathname) == 0)
+ if (procstat_getpathname(prstat, kipp, pathname, sizeof(pathname))
+ != 0 || strlen(pathname) == 0)
strcpy(pathname, "-");
if (procstat_getosrel(prstat, kipp, &osrel) != 0)
- return;
+ osrel = -1;
xo_emit("{k:process_id/%5d/%d} ", kipp->ki_pid);
xo_emit("{:command/%-16s/%s} ", kipp->ki_comm);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 22, 5:18 PM (50 m, 23 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41910339
Default Alt Text
D57493.1795367906.diff (868 B)
Attached To
Mode
D57493: procstat binary: do not skip pid if either path or osrel sysctls failed
Attached
Detach File
Event Timeline