summaryrefslogtreecommitdiff
path: root/usr.bin/openssl
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2024-07-01 18:52:23 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2024-07-01 18:52:23 +0000
commitda3ad4a6defe8e08ca63f72de1f92a989dbcc94a (patch)
tree181f5afa0caf4f1843e36f93b9dc7fad319324bc /usr.bin/openssl
parent007c77d92d6d761f020f0620b78e769f220cc22a (diff)
signal handler must use the save_errno dance, and massage a variable
of type 'volatile sig_atomic_t' ok tb
Diffstat (limited to 'usr.bin/openssl')
-rw-r--r--usr.bin/openssl/speed.c7
1 files 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;
}