commit d7da19ca6f6c025db92455cdbe3de3d7e9ab5905 from: deraadt date: Mon Jul 01 18:43:50 2024 UTC missing save_errno dance inside non-terminal signal handler commit - 6a150e5c3546e1a3429d9d14f09da33c9e132dfc commit + d7da19ca6f6c025db92455cdbe3de3d7e9ab5905 blob - fc5665f9737f4046e3ff81844b4798b0e4e0046d blob + bf7f714865cda1cb8973faa2051b861f667e5415 --- usr.bin/bgplg/misc.c +++ 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 @@ -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