$OpenBSD: patch-sysbench_sysbench_c,v 1.1.1.1 2008/04/15 14:14:08 sthen Exp $ --- sysbench/sysbench.c.orig Tue Jan 31 11:15:53 2006 +++ sysbench/sysbench.c Tue Apr 15 12:10:58 2008 @@ -423,12 +423,14 @@ int run_test(sb_test_t *test) /* Starting the test threads */ for(i = 0; i < sb_globals.num_threads; i++) { + int err; if (sb_globals.error) return 1; - if (pthread_create(&(threads[i].thread), &thread_attr, &runner_thread, - (void*)&(threads[i])) != 0) + if ((err = pthread_create(&(threads[i].thread), &thread_attr, + &runner_thread, (void*)&(threads[i]))) != 0) { - log_errno(LOG_FATAL, "Thread #%d creation failed", i); + log_text(LOG_FATAL, "Thread #%d creation failed errno = %d (%s)", + i, err, strerror(err)); return 1; } } @@ -437,9 +439,11 @@ int run_test(sb_test_t *test) log_text(LOG_INFO, "Threads started!"); for(i = 0; i < sb_globals.num_threads; i++) { - if(pthread_join(threads[i].thread, NULL)) + int err; + if((err = pthread_join(threads[i].thread, NULL))) { - log_errno(LOG_FATAL, "Thread #%d join failed", i); + log_text(LOG_FATAL, "Thread #%d join failed errno = %d (%s)", + i, err, strerror(err)); return 1; } } @@ -508,7 +512,7 @@ int init(void) return 1; } - thread_stack_size = sb_get_value_int("thread-stack-size"); + thread_stack_size = sb_get_value_size("thread-stack-size"); if (thread_stack_size <= 0) { log_text(LOG_FATAL, "Invalid value for thread-stack-size: %d.\n", thread_stack_size);