about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--reap.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/reap.c b/reap.c
index 36e3884..94ed3bd 100644
--- a/reap.c
+++ b/reap.c
@@ -37,9 +37,15 @@ void
 start_slaying(int sig)
 {
 	(void)sig;
+
+	int old_errno = errno;
+
 	if (verbose)
-		write(2, "reap: slaying\n", 14);  // async safe
+		write(2, "reap: slaying\n", 14);
+
 	do_slay = 1;
+
+	errno = old_errno;
 }
 
 // needs CONFIG_PROC_CHILDREN=y (since Linux 4.2), most modern distros have this