[side effect] Fix build error (remove unused variable)
authorSung-jae Park <nicesj.park@samsung.com>
Tue, 17 Dec 2013 10:31:37 +0000 (19:31 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Tue, 17 Dec 2013 10:39:47 +0000 (19:39 +0900)
Exit from the loop if it fails to write a char to the pipe

Change-Id: I7e984f9dd87d28200cf241e049a711ff0291b979

src/com-core_thread.c

index 2bf0f78..a6b1ccb 100644 (file)
@@ -104,7 +104,7 @@ static ssize_t write_safe(int fd, const void *data, size_t bufsz)
                                ErrPrint("Interrupted[%d] Again[%d]\n", fd, -ret);
                                break;
                        default:
-                               ErrPrint("Failed to write: %s\n", strerror(-ret));
+                               ErrPrint("Failed to write: %s (%d)\n", strerror(-ret), -ret);
                                return ret;
                        }
                }
@@ -342,7 +342,6 @@ static void *client_cb(void *data)
        int readsize;
        char event_ch;
        int fd;
-       int w_ret;
 
        DbgPrint("Thread is created for %d (server: %d)\n", tcb->handle, tcb->server_handle);
        /*!
@@ -426,6 +425,7 @@ static void *client_cb(void *data)
                 */
                if (chunk_append(tcb, chunk) < 0) {
                        destroy_chunk(chunk);
+                       break;
                }
        }