From b21c4c927df760810943d63b35c0488ce22f755a Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 1 Jul 2024 18:52:22 +0000 Subject: [PATCH] signal handler must use the save_errno dance, and massage a variable of type 'volatile sig_atomic_t' ok tb --- usr.bin/openssl/speed.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.bin/openssl/speed.c b/usr.bin/openssl/speed.c index f50d224064f..84ecb9b3baa 100644 --- a/usr.bin/openssl/speed.c +++ b/usr.bin/openssl/speed.c @@ -1,4 +1,4 @@ -/* $OpenBSD: speed.c,v 1.34 2023/07/27 07:01:50 tb Exp $ */ +/* $OpenBSD: speed.c,v 1.35 2024/07/01 18:52:22 deraadt Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -150,7 +150,7 @@ #include "./testrsa.h" #define BUFSIZE (1024*8+64) -int run = 0; +volatile sig_atomic_t run = 0; static int mr = 0; static int usertime = 1; @@ -193,7 +193,10 @@ static void sig_done(int sig); static void sig_done(int sig) { + int save_errno = errno; + signal(SIGALRM, sig_done); + errno = save_errno; run = 0; } -- 2.20.1