[openssh-commits] [openssh] 01/01: allow SIGUSR1 as synonym for SIGINFO

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Sep 14 10:32:49 AEST 2018


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 0aa1f230846ebce698e52051a107f3127024a05a
Author: Damien Miller <djm at mindrot.org>
Date:   Fri Sep 14 10:31:47 2018 +1000

    allow SIGUSR1 as synonym for SIGINFO
    
    Lets users on those unfortunate operating systems that lack SIGINFO
    still be able to obtain progress information from unit tests :)
---
 regress/unittests/test_helper/fuzz.c        | 8 ++++----
 regress/unittests/test_helper/test_helper.c | 3 +--
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/regress/unittests/test_helper/fuzz.c b/regress/unittests/test_helper/fuzz.c
index 99f1d036..78b36654 100644
--- a/regress/unittests/test_helper/fuzz.c
+++ b/regress/unittests/test_helper/fuzz.c
@@ -196,7 +196,6 @@ fuzz_dump(struct fuzz *fuzz)
 	dump(fuzz_ptr(fuzz), fuzz_len(fuzz));
 }
 
-#ifdef SIGINFO
 static struct fuzz *last_fuzz;
 
 static void
@@ -211,7 +210,6 @@ siginfo(int unused __attribute__((__unused__)))
 		atomicio(vwrite, STDERR_FILENO, buf, strlen(buf));
 	}
 }
-#endif
 
 struct fuzz *
 fuzz_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)
 
 	fuzz_next(ret);
 
-#ifdef SIGINFO
 	last_fuzz = ret;
+#ifdef SIGINFO
 	signal(SIGINFO, siginfo);
 #endif
+	signal(SIGUSR1, siginfo);
 
 	return ret;
 }
@@ -245,10 +244,11 @@ void
 fuzz_cleanup(struct fuzz *fuzz)
 {
 	FUZZ_DBG(("cleanup, fuzz = %p", fuzz));
-#ifdef SIGINFO
 	last_fuzz = NULL;
+#ifdef SIGINFO
 	signal(SIGINFO, SIG_DFL);
 #endif
+	signal(SIGUSR1, SIG_DFL);
 	assert(fuzz != NULL);
 	assert(fuzz->seed != NULL);
 	assert(fuzz->fuzzed != NULL);
diff --git a/regress/unittests/test_helper/test_helper.c b/regress/unittests/test_helper/test_helper.c
index 866f3495..4cc70852 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)
 	    *subtest_info != '\0' ? " - " : "", subtest_info);
 }
 
-#ifdef SIGINFO
 static void
 siginfo(int unused __attribute__((__unused__)))
 {
@@ -212,7 +211,6 @@ siginfo(int unused __attribute__((__unused__)))
 	test_info(buf, sizeof(buf));
 	atomicio(vwrite, STDERR_FILENO, buf, strlen(buf));
 }
-#endif
 
 void
 test_start(const char *n)
@@ -226,6 +224,7 @@ test_start(const char *n)
 #ifdef SIGINFO
 	signal(SIGINFO, siginfo);
 #endif
+	signal(SIGUSR1, siginfo);
 }
 
 void

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list