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);
}
/*
static
unsigned long test_hash(void *_key, size_t length, unsigned long seed)
{
- unsigned long key = (unsigned long) _key;
- unsigned long v;
+ unsigned int key = (unsigned int) _key;
- assert(length == sizeof(unsigned long));
- return hash_u32(&v, 1, seed);
+ assert(length == sizeof(unsigned int));
+ return hash_u32(&key, 1, seed);
}
#else
static
}
{
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)