summaryrefslogtreecommitdiff
path: root/regress/unittests/test_helper
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2018-10-19 21:29:01 +0100
committerColin Watson <cjwatson@debian.org>2018-10-19 21:29:01 +0100
commit3d246f10429fc9a37b98eabef94fe8dc7c61002b (patch)
tree1f35b42b5e5f462d35ba452e4dcfa188ce0543fd /regress/unittests/test_helper
parente6547182a54f0f268ee36e7c99319eeddffbaff2 (diff)
parentaede1c34243a6f7feae2fb2cb686ade5f9be6f3d (diff)
Import openssh_7.9p1.orig.tar.gz
Diffstat (limited to 'regress/unittests/test_helper')
-rw-r--r--regress/unittests/test_helper/fuzz.c8
-rw-r--r--regress/unittests/test_helper/test_helper.c3
2 files changed, 5 insertions, 6 deletions
diff --git a/regress/unittests/test_helper/fuzz.c b/regress/unittests/test_helper/fuzz.c
index 99f1d036c..78b36654d 100644
--- a/regress/unittests/test_helper/fuzz.c
+++ b/regress/unittests/test_helper/fuzz.c
@@ -196,7 +196,6 @@ fuzz_dump(struct fuzz *fuzz)
196 dump(fuzz_ptr(fuzz), fuzz_len(fuzz)); 196 dump(fuzz_ptr(fuzz), fuzz_len(fuzz));
197} 197}
198 198
199#ifdef SIGINFO
200static struct fuzz *last_fuzz; 199static struct fuzz *last_fuzz;
201 200
202static void 201static void
@@ -211,7 +210,6 @@ siginfo(int unused __attribute__((__unused__)))
211 atomicio(vwrite, STDERR_FILENO, buf, strlen(buf)); 210 atomicio(vwrite, STDERR_FILENO, buf, strlen(buf));
212 } 211 }
213} 212}
214#endif
215 213
216struct fuzz * 214struct fuzz *
217fuzz_begin(u_int strategies, const void *p, size_t l) 215fuzz_begin(u_int strategies, const void *p, size_t l)
@@ -233,10 +231,11 @@ fuzz_begin(u_int strategies, const void *p, size_t l)
233 231
234 fuzz_next(ret); 232 fuzz_next(ret);
235 233
236#ifdef SIGINFO
237 last_fuzz = ret; 234 last_fuzz = ret;
235#ifdef SIGINFO
238 signal(SIGINFO, siginfo); 236 signal(SIGINFO, siginfo);
239#endif 237#endif
238 signal(SIGUSR1, siginfo);
240 239
241 return ret; 240 return ret;
242} 241}
@@ -245,10 +244,11 @@ void
245fuzz_cleanup(struct fuzz *fuzz) 244fuzz_cleanup(struct fuzz *fuzz)
246{ 245{
247 FUZZ_DBG(("cleanup, fuzz = %p", fuzz)); 246 FUZZ_DBG(("cleanup, fuzz = %p", fuzz));
248#ifdef SIGINFO
249 last_fuzz = NULL; 247 last_fuzz = NULL;
248#ifdef SIGINFO
250 signal(SIGINFO, SIG_DFL); 249 signal(SIGINFO, SIG_DFL);
251#endif 250#endif
251 signal(SIGUSR1, SIG_DFL);
252 assert(fuzz != NULL); 252 assert(fuzz != NULL);
253 assert(fuzz->seed != NULL); 253 assert(fuzz->seed != NULL);
254 assert(fuzz->fuzzed != NULL); 254 assert(fuzz->fuzzed != NULL);
diff --git a/regress/unittests/test_helper/test_helper.c b/regress/unittests/test_helper/test_helper.c
index 866f3495d..4cc70852c 100644
--- a/regress/unittests/test_helper/test_helper.c
+++ b/regress/unittests/test_helper/test_helper.c
@@ -203,7 +203,6 @@ test_info(char *s, size_t len)
203 *subtest_info != '\0' ? " - " : "", subtest_info); 203 *subtest_info != '\0' ? " - " : "", subtest_info);
204} 204}
205 205
206#ifdef SIGINFO
207static void 206static void
208siginfo(int unused __attribute__((__unused__))) 207siginfo(int unused __attribute__((__unused__)))
209{ 208{
@@ -212,7 +211,6 @@ siginfo(int unused __attribute__((__unused__)))
212 test_info(buf, sizeof(buf)); 211 test_info(buf, sizeof(buf));
213 atomicio(vwrite, STDERR_FILENO, buf, strlen(buf)); 212 atomicio(vwrite, STDERR_FILENO, buf, strlen(buf));
214} 213}
215#endif
216 214
217void 215void
218test_start(const char *n) 216test_start(const char *n)
@@ -226,6 +224,7 @@ test_start(const char *n)
226#ifdef SIGINFO 224#ifdef SIGINFO
227 signal(SIGINFO, siginfo); 225 signal(SIGINFO, siginfo);
228#endif 226#endif
227 signal(SIGUSR1, siginfo);
229} 228}
230 229
231void 230void