diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-10-11 01:28:30 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-10-11 01:28:30 +0000 |
commit | c6d56dd14e3b3b96c2b5fd724e369df00d3edf39 (patch) | |
tree | 782bdde6b79d4f92ad1e4fce5cdcfd9aa494c4f0 /usr.bin/mg | |
parent | 9de29a0a70540571c60f700b1d3f39da56d90198 (diff) |
prevent trashing of errno in signal handler
Diffstat (limited to 'usr.bin/mg')
-rw-r--r-- | usr.bin/mg/dired.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/mg/dired.c b/usr.bin/mg/dired.c index c4a78f1ca67..d76283d35cb 100644 --- a/usr.bin/mg/dired.c +++ b/usr.bin/mg/dired.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dired.c,v 1.21 2005/08/09 00:53:48 kjell Exp $ */ +/* $OpenBSD: dired.c,v 1.22 2005/10/11 01:28:29 deraadt Exp $ */ /* This file is in the public domain. */ @@ -370,11 +370,12 @@ d_rename(int f, int n) void reaper(int signo __attribute__((unused))) { + int save_errno = errno, status; pid_t ret; - int status; while ((ret = waitpid(-1, &status, WNOHANG)) >= 0) ; + errno = save_errno; } /* |