From c0e8a5424dfc2383eb2c996bd3e565c4aa3d59da Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 15 Jun 2021 12:08:01 +0000 Subject: extrace: skip parent lookup for pid 1 I was getting a lot of errors that looked like extrace: process vanished before we found its parent: pid 1: redirfd Which are easily avoidable. Message-Id: <20210615120801.121874-1-hi@alyssa.is> --- extrace.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extrace.c b/extrace.c index e3a441a..4848a6f 100644 --- a/extrace.c +++ b/extrace.c @@ -140,6 +140,9 @@ pid_depth(pid_t pid) char *s; int fd, d, i; + if (pid == 1) + return 0; + snprintf(name, sizeof name, "/proc/%d/stat", pid); if ((fd = open(name, O_RDONLY)) < 0) -- cgit 1.4.1