mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-19 22:46:36 -05:00
Error check all the thread operations
No error is expected, and this enforces that expectation.
This commit is contained in:
parent
d13cd42784
commit
0707b1f446
8 changed files with 206 additions and 151 deletions
|
|
@ -1021,12 +1021,7 @@ static int device_thread(tommy_list* list, void* (*func)(void* arg))
|
|||
for (i = tommy_list_head(list); i != 0; i = i->next) {
|
||||
devinfo_t* devinfo = i->data;
|
||||
|
||||
if (pthread_create(&devinfo->thread, 0, func, devinfo) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal("Failed to create thread.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
thread_create(&devinfo->thread, 0, func, devinfo);
|
||||
}
|
||||
|
||||
/* join all threads */
|
||||
|
|
@ -1034,12 +1029,7 @@ static int device_thread(tommy_list* list, void* (*func)(void* arg))
|
|||
devinfo_t* devinfo = i->data;
|
||||
void* retval;
|
||||
|
||||
if (pthread_join(devinfo->thread, &retval) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal("Failed to join thread.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
thread_join(devinfo->thread, &retval);
|
||||
|
||||
if (retval != 0)
|
||||
++fail;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue