From: Mathieu Desnoyers Date: Wed, 5 Oct 2011 02:42:29 +0000 (-0400) Subject: rculfhash test: handle write return value X-Git-Tag: v0.7.0~43^2~99 X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=commitdiff_plain;h=3fb1173c93240deac2f4a9ca9a24a4c8f24c772a rculfhash test: handle write return value Signed-off-by: Mathieu Desnoyers --- diff --git a/tests/test_urcu_hash.c b/tests/test_urcu_hash.c index ffaec29..db45c8c 100644 --- a/tests/test_urcu_hash.c +++ b/tests/test_urcu_hash.c @@ -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)