Change in osmo-pcu[master]: Don't register SIGHUP handler without actually handling SIGHUP

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue May 15 15:30:56 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9165 )

Change subject: Don't register SIGHUP handler without actually handling SIGHUP
......................................................................

Don't register SIGHUP handler without actually handling SIGHUP

In libosmocore, we normally register a SIGHUP handler for log file
rotation.

However, the osmo-pcu code so far installed its own signal handler,
which did exactly nothing in the SIGHUP case.

Let's fix this by removing SIGHUP handling here, letting libosmocore
take care about this.

Change-Id: Ifa20d79770bc4d88d40601b008a3a2a79d083c04
Closes: OS#3265
---
M src/pcu_main.cpp
1 file changed, 2 insertions(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp
index 5b1b1be..7480842 100644
--- a/src/pcu_main.cpp
+++ b/src/pcu_main.cpp
@@ -143,7 +143,7 @@
 
 void sighandler(int sigset)
 {
-	if (sigset == SIGHUP || sigset == SIGPIPE)
+	if (sigset == SIGPIPE)
 		return;
 
 	fprintf(stderr, "Signal %d received.\n", sigset);
@@ -155,7 +155,6 @@
 		 * is terminated without finishing shutdown process.
 		 */
 		signal(SIGINT, SIG_DFL);
-		signal(SIGHUP, SIG_DFL);
 		signal(SIGTERM, SIG_DFL);
 		signal(SIGPIPE, SIG_DFL);
 		signal(SIGABRT, SIG_DFL);
@@ -311,12 +310,12 @@
 		return rc;
 
 	signal(SIGINT, sighandler);
-	signal(SIGHUP, sighandler);
 	signal(SIGTERM, sighandler);
 	signal(SIGPIPE, sighandler);
 	signal(SIGABRT, sighandler);
 	signal(SIGUSR1, sighandler);
 	signal(SIGUSR2, sighandler);
+	osmo_init_ignore_signals();
 
 	/* enable realtime priority for us */
 	if (rt_prio != -1) {

-- 
To view, visit https://gerrit.osmocom.org/9165
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifa20d79770bc4d88d40601b008a3a2a79d083c04
Gerrit-Change-Number: 9165
Gerrit-PatchSet: 5
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180515/e3e35f35/attachment.htm>


More information about the gerrit-log mailing list