summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatolii Nikulin <nikulin.a@samsung.com>2015-11-25 14:51:10 +0300
committerDmitry Kovalenko <d.kovalenko@samsung.com>2015-11-27 03:00:15 -0800
commit714601393f7369e62b4fcb32516f2188f8545b68 (patch)
tree0a500d146c2af6412e733e4ebfba928b0ddf2714
parentbf73567a33867bfaf70145edcb2794a679beface (diff)
downloadswap-probe-tizen_2.4_uihv.tar.gz
swap-probe-tizen_2.4_uihv.tar.bz2
swap-probe-tizen_2.4_uihv.zip
[FIX] disable signal SIGPIPEtizen_2.4_uihv
Use flag MSG_NOSIGNAL in send() to supress signal SIGPIPE when send message to socket, closed by other side Change-Id: I0c4bfe90ded211f55fc5eebf5c4e4223d9d47a9f Signed-off-by: Anatolii Nikulin <nikulin.a@samsung.com>
-rwxr-xr-xhelper/libdaprobe.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/helper/libdaprobe.c b/helper/libdaprobe.c
index 7f349a9..16be7ef 100755
--- a/helper/libdaprobe.c
+++ b/helper/libdaprobe.c
@@ -611,7 +611,7 @@ bool printLog(log_t *log, int msgType)
len = sizeof(log->type) + sizeof(log->length) + log->length;
real_pthread_mutex_lock(&(gTraceInfo.socket.sockMutex));
- res = send(gTraceInfo.socket.daemonSock, log, len, 0);
+ res = send(gTraceInfo.socket.daemonSock, log, len, MSG_NOSIGNAL);
real_pthread_mutex_unlock(&(gTraceInfo.socket.sockMutex));
return (res == len);
@@ -645,7 +645,7 @@ bool print_log_str(int msgType, char *str)
/* lock socket and send */
real_pthread_mutex_lock(&(gTraceInfo.socket.sockMutex));
- res = send(gTraceInfo.socket.daemonSock, &log, len, 0);
+ res = send(gTraceInfo.socket.daemonSock, &log, len, MSG_NOSIGNAL);
real_pthread_mutex_unlock(&(gTraceInfo.socket.sockMutex));
return (res == len);
@@ -702,7 +702,8 @@ bool print_log_fmt(int msgType, const char *func_name, int line, ...)
real_pthread_mutex_lock(&(gTraceInfo.socket.sockMutex));
if(unlikely(gTraceInfo.socket.daemonSock != -1)) {
- res = send(gTraceInfo.socket.daemonSock, &log, len, MSG_DONTWAIT);
+ res = send(gTraceInfo.socket.daemonSock, &log, len,
+ MSG_DONTWAIT | MSG_NOSIGNAL);
} else {
/* if socket is not connected, out to stderr */
fprintf(stderr, "%s %s\n", msg_code_to_srt(msgType), log.data);