X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_hash.c;h=db45c8c389801a3af5a40dfc58c3e2a492172dc0;hb=238cc06e5728e3a642d4d22bd4fc199cfd265110;hp=cbbddc8c8cef72d9d59a1ee08f1b6e970748bd69;hpb=bda211266cd93d5d01adb4007c08f3bdf88a4047;p=urcu.git diff --git a/tests/test_urcu_hash.c b/tests/test_urcu_hash.c index cbbddc8..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); } /* @@ -349,9 +353,9 @@ void hashword2( static unsigned long test_hash(void *_key, size_t length, unsigned long seed) { - unsigned long key = (unsigned long) _key; + unsigned int key = (unsigned int) _key; - assert(length == sizeof(unsigned long)); + assert(length == sizeof(unsigned int)); return hash_u32(&key, 1, seed); } #else @@ -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)