summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKunhoon Baik <knhoon.baik@samsung.com>2016-10-27 09:12:07 +0900
committerYunmi Ha <yunmi.ha@samsung.com>2016-11-03 15:01:09 +0900
commit21f31f20b2f1541f15fe06cd26fce221120dda78 (patch)
tree1a939addcffd7b0d23e008839880d279cd04d2e7
parentb76dbe8c10c63b1cf2ddbb91b2c13165da43d08b (diff)
downloadtlm-21f31f20b2f1541f15fe06cd26fce221120dda78.tar.gz
tlm-21f31f20b2f1541f15fe06cd26fce221120dda78.tar.bz2
tlm-21f31f20b2f1541f15fe06cd26fce221120dda78.zip
TLM session daemon uses several communication libraries like syslog, pam, and so on. Thus, basically it should handle SIGPIPE. Otherwise, the daemon will be exited unexpectedly, it will make user-session unstable. Change-Id: Idd52ba703f3e732b6ccc6c9f1a35c18a952c0f9b
-rwxr-xr-xsrc/sessiond/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sessiond/main.c b/src/sessiond/main.c
index d0e4db6..23317d9 100755
--- a/src/sessiond/main.c
+++ b/src/sessiond/main.c
@@ -72,6 +72,12 @@ _install_sighandlers (GMainLoop *main_loop)
WARN ("failed to ignore SIGINT: %s", strerror_r(errno, strerr_buf, MAX_STRERROR_LEN));
}
+ if (signal (SIGPIPE, SIG_IGN) == SIG_ERR)
+ {
+ gchar strerr_buf[MAX_STRERROR_LEN] = {0,};
+ WARN ("failed to ignore SIGPIPE: %s", strerror_r(errno, strerr_buf, MAX_STRERROR_LEN));
+ }
+
source = g_unix_signal_source_new (SIGTERM);
g_source_set_callback (source,
_handle_quit_signal,