[openssh-commits] [openssh] 01/02: wrap SIGINFO in ifdef

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Aug 18 14:22:36 AEST 2025


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

djm pushed a commit to branch master
in repository openssh.

commit b7ee13fbbb4ebafcf71f29685f053ecb97d1bcef
Author: Damien Miller <djm at mindrot.org>
AuthorDate: Mon Aug 18 14:22:18 2025 +1000

    wrap SIGINFO in ifdef
---
 clientloop.c | 11 +++++++++--
 serverloop.c |  9 +++++++--
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/clientloop.c b/clientloop.c
index 677bf40f0..b9a010414 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -225,12 +225,14 @@ window_change_handler(int sig)
 	received_window_change_signal = 1;
 }
 
+#ifdef SIGINFO
 /* Signal handler for SIGINFO */
 static void
 siginfo_handler(int sig)
 {
 	siginfo_received = 1;
 }
+#endif
 
 /*
  * Signal handler for signals that cause the program to terminate.  These
@@ -1522,7 +1524,9 @@ client_loop(struct ssh *ssh, int have_pty, int escape_char_arg,
 	if (ssh_signal(SIGTERM, SIG_IGN) != SIG_IGN)
 		ssh_signal(SIGTERM, signal_handler);
 	ssh_signal(SIGWINCH, window_change_handler);
+#ifdef SIGINFO
 	ssh_signal(SIGINFO, siginfo_handler);
+#endif
 
 	if (have_pty)
 		enter_raw_mode(options.request_tty == REQUEST_TTY_FORCE);
@@ -1545,9 +1549,12 @@ client_loop(struct ssh *ssh, int have_pty, int escape_char_arg,
 	    sigaddset(&bsigset, SIGHUP) == -1 ||
 	    sigaddset(&bsigset, SIGINT) == -1 ||
 	    sigaddset(&bsigset, SIGQUIT) == -1 ||
-	    sigaddset(&bsigset, SIGTERM) == -1 ||
-	    sigaddset(&bsigset, SIGINFO) == -1)
+	    sigaddset(&bsigset, SIGTERM) == -1)
 		error_f("bsigset setup: %s", strerror(errno));
+#ifdef SIGINFO
+	if (sigaddset(&bsigset, SIGINFO) == -1)
+		error_f("bsigset setup: %s", strerror(errno));
+#endif
 
 	/* Main loop of the client for the interactive session mode. */
 	while (!quit_pending) {
diff --git a/serverloop.c b/serverloop.c
index 753f56388..4beb2a390 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -104,11 +104,13 @@ sigchld_handler(int sig)
 	child_terminated = 1;
 }
 
+#ifdef SIGINFO
 static void
 siginfo_handler(int sig)
 {
 	siginfo_received = 1;
 }
+#endif
 
 static void
 client_alive_check(struct ssh *ssh)
@@ -341,11 +343,14 @@ server_loop2(struct ssh *ssh, Authctxt *authctxt)
 	debug("Entering interactive session for SSH2.");
 
 	if (sigemptyset(&bsigset) == -1 ||
-	    sigaddset(&bsigset, SIGCHLD) == -1 ||
-	    sigaddset(&bsigset, SIGINFO) == -1)
+	    sigaddset(&bsigset, SIGCHLD) == -1)
 		error_f("bsigset setup: %s", strerror(errno));
 	ssh_signal(SIGCHLD, sigchld_handler);
+#ifdef SIGINFO
+	if (sigaddset(&bsigset, SIGINFO) == -1)
+		error_f("bsigset setup: %s", strerror(errno));
 	ssh_signal(SIGINFO, siginfo_handler);
+#endif
 	child_terminated = 0;
 	connection_in = ssh_packet_get_connection_in(ssh);
 	connection_out = ssh_packet_get_connection_out(ssh);

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


More information about the openssh-commits mailing list