projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rculfhash test: handle write return value
[urcu.git]
/
tests
/
test_urcu_hash.c
diff --git
a/tests/test_urcu_hash.c
b/tests/test_urcu_hash.c
index 98227c219abf11e9ea7aa667ecad4e98e65f8278..db45c8c389801a3af5a40dfc58c3e2a492172dc0 100644
(file)
--- 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 };
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,11
+353,10
@@
void hashword2(
static
unsigned long test_hash(void *_key, size_t length, unsigned long seed)
{
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
}
#else
static
@@
-944,7
+947,11
@@
int main(int argc, char **argv)
}
{
char msg[1] = { 0x42 };
}
{
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)
}
err = pthread_join(tid_count, &tret);
if (err != 0)
This page took
0.025451 seconds
and
4
git commands to generate.