rculfhash test: handle write return value
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 5 Oct 2011 02:42:29 +0000 (22:42 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 5 Oct 2011 02:42:29 +0000 (22:42 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/test_urcu_hash.c

index ffaec29f77e5fa2cde19b170c8fc58dc08d82477..db45c8c389801a3af5a40dfc58c3e2a492172dc0 100644 (file)
@@ -200,7 +200,11 @@ static
 void sigusr2_handler(int signo)
 {
        char msg[1] = { 0x42 };
-       write(count_pipe[1], msg, 1);   /* wakeup thread */
+       ssize_t ret;
+
+       do {
+               ret = write(count_pipe[1], msg, 1);     /* wakeup thread */
+       } while (ret == -1L && errno == EINTR);
 }
 
 /*
@@ -943,7 +947,11 @@ int main(int argc, char **argv)
        }
        {
                char msg[1] = { 0x42 };
-               write(count_pipe[1], msg, 1);   /* wakeup thread */
+               ssize_t ret;
+
+               do {
+                       ret = write(count_pipe[1], msg, 1);     /* wakeup thread */
+               } while (ret == -1L && errno == EINTR);
        }
        err = pthread_join(tid_count, &tret);
        if (err != 0)
This page took 0.030544 seconds and 4 git commands to generate.