Ingore SIGPIPE default behavior 91/95391/1 accepted/tizen/3.0/common/20161114.082020 accepted/tizen/3.0/ivi/20161103.131426 accepted/tizen/3.0/mobile/20161103.131331 accepted/tizen/3.0/tv/20161103.131349 accepted/tizen/3.0/wearable/20161103.131403 submit/tizen_3.0/20161103.060416 submit/tizen_3.0_common/20161110.084657
authorKunhoon Baik <knhoon.baik@samsung.com>
Thu, 27 Oct 2016 00:12:07 +0000 (09:12 +0900)
committerYunmi Ha <yunmi.ha@samsung.com>
Thu, 3 Nov 2016 06:01:09 +0000 (15:01 +0900)
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

src/sessiond/main.c

index d0e4db6..23317d9 100755 (executable)
@@ -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,