Add log for thread join error.

This commit is contained in:
Pascal Obry
2015-10-25 18:58:17 +01:00
parent d87aff0290
commit a3c644fd74
+3 -2
View File
@@ -342,7 +342,7 @@ void run_segment_threads(const char *method, int segments, int full_segments, in
fprintf(stderr, "couldn't get the path name\n");
#endif
int i;
int i, ret;
for (i = 0; i < segments; i++) {
info[i].method = method;
info[i].fp = fopen(file_path, method[0] == 'G' ? "r+" : "r");
@@ -354,7 +354,8 @@ void run_segment_threads(const char *method, int segments, int full_segments, in
}
for (i = 0; i < segments; i++) {
pthread_join(threads[i], NULL);
if ((ret = pthread_join(threads[i], NULL)) != 0)
fprintf(stderr, "error waiting for thread %d, status = %d\n", i, ret);
}
free(info);
free(threads);