summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-04-12 19:01:55 +0200
committerLeah Neukirchen <leah@vuxu.org>2022-04-12 19:01:55 +0200
commit4757774f75c126586a917a049a9c345396409089 (patch)
tree05b0809466a153ebb6dad2c05acfae86e3c9724e
parentd15ba797f08bef5c234135e1a3360318c63c2205 (diff)
downloadrvnit-master.tar.gz
rvnit-master.tar.xz
rvnit-master.zip
restore errno in error handler HEAD master
-rw-r--r--rvnit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/rvnit.c b/rvnit.c
index 46a1009..1ba37aa 100644
--- a/rvnit.c
+++ b/rvnit.c
@@ -75,6 +75,8 @@ int want_rescandir;
 void
 on_signal(int sig)
 {
+	int old_errno = errno;
+
 	switch (sig) {
 	case SIGINT:
 		if (real_pid1)
@@ -92,6 +94,8 @@ on_signal(int sig)
 		write(selfpipe[1], "", 1);
 		break;
 	}
+
+	errno = old_errno;
 }
 
 pid_t