summaryrefslogtreecommitdiff
path: root/tests/exit3.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/exit3.c')
-rw-r--r--tests/exit3.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/exit3.c b/tests/exit3.c
index f15b39d..b666624 100644
--- a/tests/exit3.c
+++ b/tests/exit3.c
@@ -4,8 +4,7 @@
* Depends on API functions: pthread_create().
*/
-#include <pthread.h>
-#include <stdio.h>
+#include "test.h"
void *
func(void * arg)
@@ -13,7 +12,7 @@ func(void * arg)
pthread_exit(arg);
/* Never reached. */
- return 0;
+ exit(1);
}
int
@@ -25,11 +24,8 @@ main(int argc, char * argv[])
/* Create a few threads and then exit. */
for (i = 0; i < 4; i++)
{
- if (pthread_create(&id[i], NULL, func, (void *) i) != 0)
- {
- return 1;
- }
- }
+ assert(pthread_create(&id[i], NULL, func, (void *) i) == 0);
+ }
/* Success. */
return 0;