diff options
author | deraadt <> | 2024-07-01 18:52:22 +0000 |
---|---|---|
committer | deraadt <> | 2024-07-01 18:52:22 +0000 |
commit | 5952f49aae4db58cac4ed0af4d55b7ce64032303 (patch) | |
tree | b161d797b9285df7981b4e5f04a876449a4187f7 /src | |
parent | 44999a077ead48476ede7c66f756255656af8edc (diff) | |
download | openbsd-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.c | 7 |
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) |
153 | int run = 0; | 153 | volatile sig_atomic_t run = 0; |
154 | 154 | ||
155 | static int mr = 0; | 155 | static int mr = 0; |
156 | static int usertime = 1; | 156 | static int usertime = 1; |
@@ -193,7 +193,10 @@ static void sig_done(int sig); | |||
193 | static void | 193 | static void |
194 | sig_done(int sig) | 194 | sig_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 | ||