diff options
author | 2011-06-03 06:52:37 +0000 | |
---|---|---|
committer | 2011-06-03 06:52:37 +0000 | |
commit | 87eeae219b05a8ecb5f1ec5616eec60e01847e17 (patch) | |
tree | 947da87de34ddfa6e0c8d9a2400c4cec0503d2a7 | |
parent | Make ^D behave: dont't echo it and make it work if the cursor is at (diff) | |
download | wireguard-openbsd-87eeae219b05a8ecb5f1ec5616eec60e01847e17.tar.xz wireguard-openbsd-87eeae219b05a8ecb5f1ec5616eec60e01847e17.zip |
protect errno from damage in the signal handler
ok otto
-rw-r--r-- | usr.bin/bc/bc.y | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/bc/bc.y b/usr.bin/bc/bc.y index b1ee4e467df..cd27e1720af 100644 --- a/usr.bin/bc/bc.y +++ b/usr.bin/bc/bc.y @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: bc.y,v 1.36 2011/06/03 06:10:31 otto Exp $ */ +/* $OpenBSD: bc.y,v 1.37 2011/06/03 06:52:37 deraadt Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek <otto@drijf.net> @@ -1058,7 +1058,7 @@ void sigchld(int signo) { pid_t pid; - int status; + int status, save_errno = errno; for (;;) { pid = waitpid(dc, &status, WCONTINUED); @@ -1072,6 +1072,7 @@ sigchld(int signo) else break; } + errno = save_errno; } static const char * |