Cygwin: Fixup of wait pipe hangup commit
authorChristian Babeux <christian.babeux@efficios.com>
Mon, 3 Dec 2012 03:07:52 +0000 (22:07 -0500)
committerChristian Babeux <christian.babeux@efficios.com>
Fri, 7 Dec 2012 20:17:55 +0000 (15:17 -0500)
The condition in lttng_ustconsumer_check_pipe was wrong.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
src/common/ust-consumer/ust-consumer.c

index 9d624966bf6ae76f942401c5c9b8b1205bdaef54..31e0d4ba7a5a219436fbf234e515062cdac6adfb 100644 (file)
@@ -424,17 +424,19 @@ int lttng_ustconsumer_check_pipe(struct lttng_consumer_stream *stream,
                stream->wait_fd, stream->key);
 
        /* We consume the 1 byte written into the wait_fd by UST */
-       if (!stream->hangup_flush_done) {
-               do {
-                       readlen = read(stream->wait_fd, &dummy, 1);
-               } while (readlen == -1 && errno == EINTR);
-               if (readlen == -1) {
-                       return -1;      /* error */
-               }
-               DBG("Read %zu byte from pipe: %c\n", readlen, dummy);
-               if (readlen == 0)
-                       return 1;       /* POLLHUP */
+
+       do {
+               readlen = read(stream->wait_fd, &dummy, 1);
+       } while (readlen == -1 && errno == EINTR);
+       if (readlen == -1) {
+               return -1;      /* error */
        }
+
+       DBG("Read %zu byte from pipe: %c\n", readlen, readlen ? dummy : '\0');
+
+       if (readlen == 0)
+               return 1;       /* POLLHUP */
+
        return 0;       /* no error nor HUP */
 
 }
This page took 0.02575 seconds and 4 git commands to generate.