* Replaced bogus perror() calls with printf()s.

* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36297 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2010-04-15 15:25:10 +00:00
parent af0bb8e3d3
commit 2385d1bdc8
@@ -17,9 +17,10 @@
* *
*/ */
#include <errno.h>
#include <pthread.h> #include <pthread.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "posixtest.h" #include "posixtest.h"
@@ -32,7 +33,7 @@ void *a_thread_func()
/* If the thread wasn't canceled in 10 seconds, time out */ /* If the thread wasn't canceled in 10 seconds, time out */
sleep(10); sleep(10);
perror("Thread couldn't be canceled (at cleanup time), timing out\n"); printf("Thread couldn't be canceled (at cleanup time), timing out\n");
pthread_exit(0); pthread_exit(0);
return NULL; return NULL;
} }
@@ -46,21 +47,21 @@ int main()
/* Initialize attribute */ /* Initialize attribute */
if(pthread_attr_init(&new_attr) != 0) if(pthread_attr_init(&new_attr) != 0)
{ {
perror("Cannot initialize attribute object\n"); printf("Cannot initialize attribute object\n");
return PTS_UNRESOLVED; return PTS_UNRESOLVED;
} }
/* Set the attribute object to be joinable */ /* Set the attribute object to be joinable */
if(pthread_attr_setdetachstate(&new_attr, PTHREAD_CREATE_JOINABLE) != 0) if(pthread_attr_setdetachstate(&new_attr, PTHREAD_CREATE_JOINABLE) != 0)
{ {
perror("Error in pthread_attr_setdetachstate()\n"); printf("Error in pthread_attr_setdetachstate()\n");
return PTS_UNRESOLVED; return PTS_UNRESOLVED;
} }
/* Create the thread */ /* Create the thread */
if(pthread_create(&new_th, &new_attr, a_thread_func, NULL) != 0) if(pthread_create(&new_th, &new_attr, a_thread_func, NULL) != 0)
{ {
perror("Error creating thread\n"); printf("Error creating thread\n");
return PTS_UNRESOLVED; return PTS_UNRESOLVED;
} }
@@ -81,7 +82,7 @@ int main()
printf("Test FAILED\n"); printf("Test FAILED\n");
return PTS_FAIL; return PTS_FAIL;
} }
perror("Error canceling thread\n"); printf("Error canceling thread: %s\n", strerror(ret));
return PTS_UNRESOLVED; return PTS_UNRESOLVED;
} }