Apply MSG_NOSIGNAL to the api using 'send' system call. 58/110958/1 tizen_3.0_tv accepted/tizen/3.0/common/20170120.102319 accepted/tizen/3.0/common/20170131.161751 accepted/tizen/3.0/ivi/20170120.073109 accepted/tizen/3.0/ivi/20170131.090419 accepted/tizen/3.0/mobile/20170120.073021 accepted/tizen/3.0/mobile/20170131.090333 accepted/tizen/3.0/tv/20170120.073037 accepted/tizen/3.0/tv/20170131.090351 accepted/tizen/3.0/wearable/20170120.073054 accepted/tizen/3.0/wearable/20170131.090407 submit/tizen_3.0/20170119.095646 submit/tizen_3.0/20170131.015755
authorjongmyeongko <jongmyeong.ko@samsung.com>
Wed, 18 Jan 2017 06:27:17 +0000 (15:27 +0900)
committerjongmyeongko <jongmyeong.ko@samsung.com>
Thu, 19 Jan 2017 03:38:52 +0000 (12:38 +0900)
From a certain cause, if the pipe is broken, then the process will be aborted unexpectedly
and the remaining behavior of that process will be skipped.
The SIGPIPE signal cause this abort.
So, to prevent the unexpect abort, the MSG_NOSIGNAL flag can be the solution.
Becuase, this flag turns off the signaling caused by current system call.
Even though the signaling is off, the process could know the pipe error from errno(EPIPE).

Change-Id: Ifd35062947a24982b160f0774546a855332c7b94
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
installer/pkgmgr_installer.c

index 443bad5..70ab512 100644 (file)
@@ -218,7 +218,7 @@ static int __send_signal_to_agent(uid_t uid, void *data, size_t len)
                return -1;
        }
 
-       r = send(fd, data, len, 0);
+       r = send(fd, data, len, MSG_NOSIGNAL);
        if (r < 0) {
                ERR("failed to send data: %d", errno);
                close(fd);