projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
t/zbd: avoid test case 31 failure with small devices
[fio.git]
/
helper_thread.c
diff --git
a/helper_thread.c
b/helper_thread.c
index 77016638f5d35835a658c691aaa4c2c5d2ccc2ae..332ccb53c254e45087919f9a1f758390a9873f2f 100644
(file)
--- a/
helper_thread.c
+++ b/
helper_thread.c
@@
-1,4
+1,7
@@
+#include <errno.h>
#include <signal.h>
#include <signal.h>
+#include <stdio.h>
+#include <string.h>
#include <unistd.h>
#ifdef CONFIG_HAVE_TIMERFD_CREATE
#include <sys/timerfd.h>
#include <unistd.h>
#ifdef CONFIG_HAVE_TIMERFD_CREATE
#include <sys/timerfd.h>
@@
-103,13
+106,14
@@
static int read_from_pipe(int fd, void *buf, size_t len)
static void block_signals(void)
{
static void block_signals(void)
{
-#ifdef
HAVE
_PTHREAD_SIGMASK
+#ifdef
CONFIG
_PTHREAD_SIGMASK
sigset_t sigmask;
sigset_t sigmask;
+ int ret;
+
ret = pthread_sigmask(SIG_UNBLOCK, NULL, &sigmask);
assert(ret == 0);
ret = pthread_sigmask(SIG_BLOCK, &sigmask, NULL);
ret = pthread_sigmask(SIG_UNBLOCK, NULL, &sigmask);
assert(ret == 0);
ret = pthread_sigmask(SIG_BLOCK, &sigmask, NULL);
- assert(ret == 0);
#endif
}
#endif
}
@@
-122,7
+126,10
@@
static void submit_action(enum action a)
return;
ret = write_to_pipe(helper_data->pipe[1], &data, sizeof(data));
return;
ret = write_to_pipe(helper_data->pipe[1], &data, sizeof(data));
- assert(ret == 1);
+ if (ret != 1) {
+ log_err("failed to write action into pipe, err %i:%s", errno, strerror(errno));
+ assert(0);
+ }
}
void helper_reset(void)
}
void helper_reset(void)
@@
-154,7
+161,6
@@
void helper_thread_exit(void)
return;
helper_data->exit = 1;
return;
helper_data->exit = 1;
- submit_action(A_EXIT);
pthread_join(helper_data->thread, NULL);
}
pthread_join(helper_data->thread, NULL);
}