Prevent SIGPIPE 55/111155/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 19 Jan 2017 22:51:15 +0000 (07:51 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 19 Jan 2017 22:51:15 +0000 (07:51 +0900)
- Use MSG_NOSIGNAL option

Change-Id: I62cbf54ca004b65e022f3365ee6930a92674b165
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/launchpad_common.c

index 8d6c001..5e998c5 100644 (file)
@@ -250,7 +250,7 @@ int _send_cmd_to_amd(int cmd)
        }
 
        pkt.cmd = cmd;
-       ret = send(fd, &pkt, sizeof(app_pkt_t), 0);
+       ret = send(fd, &pkt, sizeof(app_pkt_t), MSG_NOSIGNAL);
        if (ret <= 0) {
                _E("Failed to send cmd(%d), errno(%d)", cmd, errno);
                close(fd);
@@ -392,7 +392,7 @@ int _send_pkt_raw(int client_fd, app_pkt_t *pkt)
 
        pkt_size = AUL_PKT_HEADER_SIZE + pkt->len;
 
-       send_ret = send(client_fd, pkt, pkt_size, 0);
+       send_ret = send(client_fd, pkt, pkt_size, MSG_NOSIGNAL);
        _D("send(%d) : %d / %d", client_fd, send_ret, pkt_size);
 
        if (send_ret == -1) {
@@ -609,7 +609,7 @@ int _connect_to_launchpad(int type, int id)
                _D("re-connect to %s (%d)", addr.sun_path, retry);
        }
 
-       send_ret = send(fd, &client_pid, sizeof(client_pid), 0);
+       send_ret = send(fd, &client_pid, sizeof(client_pid), MSG_NOSIGNAL);
        _D("send(%d) : %d", client_pid, send_ret);
 
        if (send_ret == -1) {