Correct usage of send() system call 66/124066/1
authorAbhishek Sansanwal <abhishek.s94@samsung.com>
Mon, 10 Apr 2017 06:06:39 +0000 (11:36 +0530)
committerAbhishek Sansanwal <abhishek.s94@samsung.com>
Mon, 10 Apr 2017 06:11:05 +0000 (11:41 +0530)
Description: Correct usage of send() system call,
using MSG_NOSIGNAL flag to handle SIGPIPE properly

Signed-off-by: Abhishek Sansanwal <abhishek.s94@samsung.com>
Change-Id: Idb894e5b11a0a24228e8c55a121e3678fad6d90d

src/utils/network-accessibility.c

index 7690ecc..df1312c 100755 (executable)
@@ -291,7 +291,7 @@ static gboolean __send_data_event(GIOChannel *channel,
        if (net_params->header_done == TRUE)
                return FALSE;
 
-       n = send(fd, request_data, strlen(request_data), 0);
+       n = send(fd, request_data, strlen(request_data), MSG_NOSIGNAL);
        DBG("Sent %d bytes", n);
 
        if (n < 0) {