summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2024-07-01 18:43:51 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2024-07-01 18:43:51 +0000
commit007c77d92d6d761f020f0620b78e769f220cc22a (patch)
treefa208aa0e1d4d0609c6adfd9d9f5d1b7421685fd /usr.bin
parentebcfb6575ca624884df694a5ddf8d6198da23a06 (diff)
missing save_errno dance inside non-terminal signal handler
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/bgplg/misc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/bgplg/misc.c b/usr.bin/bgplg/misc.c
index fc5665f9737..bf7f714865c 100644
--- a/usr.bin/bgplg/misc.c
+++ b/usr.bin/bgplg/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.8 2017/12/18 09:12:49 job Exp $ */
+/* $OpenBSD: misc.c,v 1.9 2024/07/01 18:43:50 deraadt Exp $ */
/*
* Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org>
@@ -79,10 +79,13 @@ lg_help(struct cmd *cmds, char **argv)
void
lg_sig_alarm(int sig)
{
+ int save_errno = errno;
+
if (child != -1) {
/* Forcibly kill the child, no excuse... */
kill(child, SIGKILL);
}
+ errno = save_errno;
}
int