summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorderaadt <>2024-07-01 18:52:22 +0000
committerderaadt <>2024-07-01 18:52:22 +0000
commit5952f49aae4db58cac4ed0af4d55b7ce64032303 (patch)
treeb161d797b9285df7981b4e5f04a876449a4187f7 /src
parent44999a077ead48476ede7c66f756255656af8edc (diff)
downloadopenbsd-5952f49aae4db58cac4ed0af4d55b7ce64032303.tar.gz
openbsd-5952f49aae4db58cac4ed0af4d55b7ce64032303.tar.bz2
openbsd-5952f49aae4db58cac4ed0af4d55b7ce64032303.zip
signal handler must use the save_errno dance, and massage a variable
of type 'volatile sig_atomic_t' ok tb
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/openssl/speed.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/usr.bin/openssl/speed.c b/src/usr.bin/openssl/speed.c
index f50d224064..84ecb9b3ba 100644
--- a/src/usr.bin/openssl/speed.c
+++ b/src/usr.bin/openssl/speed.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: speed.c,v 1.34 2023/07/27 07:01:50 tb Exp $ */ 1/* $OpenBSD: speed.c,v 1.35 2024/07/01 18:52:22 deraadt Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -150,7 +150,7 @@
150#include "./testrsa.h" 150#include "./testrsa.h"
151 151
152#define BUFSIZE (1024*8+64) 152#define BUFSIZE (1024*8+64)
153int run = 0; 153volatile sig_atomic_t run = 0;
154 154
155static int mr = 0; 155static int mr = 0;
156static int usertime = 1; 156static int usertime = 1;
@@ -193,7 +193,10 @@ static void sig_done(int sig);
193static void 193static void
194sig_done(int sig) 194sig_done(int sig)
195{ 195{
196 int save_errno = errno;
197
196 signal(SIGALRM, sig_done); 198 signal(SIGALRM, sig_done);
199 errno = save_errno;
197 run = 0; 200 run = 0;
198} 201}
199 202