From: jongmyeongko Date: Wed, 18 Jan 2017 06:27:17 +0000 (+0900) Subject: Apply MSG_NOSIGNAL to the api using 'send' system call. X-Git-Tag: submit/tizen/20170119.070147~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=95c4212fc0ff1a08ba74a27a32fbb61a046e4e67;p=platform%2Fcore%2Fappfw%2Fslp-pkgmgr.git Apply MSG_NOSIGNAL to the api using 'send' system call. 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 --- diff --git a/installer/pkgmgr_installer.c b/installer/pkgmgr_installer.c index bcf44e7..36279ab 100644 --- a/installer/pkgmgr_installer.c +++ b/installer/pkgmgr_installer.c @@ -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);