openposix: Add '\n' at the end of printf
PATCH 1/1 openposix: Add '\n' at the end of printf
We need to add '\n' at the end of printf, or the print string may be orderless with error output.
For all of the files of dir testcases/open_posix_testsuite/* which referenced.
Signed-off-by Zhao Gongyi <[email protected]>
--- .../conformance/interfaces/fork/19-1.c | 6 +++--- .../conformance/interfaces/localtime/1-1.c | 2 +- .../pthread_attr_setschedparam/speculative/3-2.c | 2 +- .../interfaces/pthread_barrier_destroy/2-1.c | 2 +- .../conformance/interfaces/pthread_barrier_init/4-1.c | 2 +- .../conformance/interfaces/pthread_barrier_wait/1-1.c | 2 +- .../conformance/interfaces/pthread_barrier_wait/2-1.c | 2 +- .../conformance/interfaces/pthread_barrier_wait/3-1.c | 2 +- .../conformance/interfaces/pthread_barrier_wait/3-2.c | 2 +- .../interfaces/pthread_barrierattr_getpshared/1-1.c | 2 +- .../interfaces/pthread_barrierattr_getpshared/2-1.c | 2 +- .../interfaces/pthread_barrierattr_init/1-1.c | 2 +- .../interfaces/pthread_barrierattr_init/2-1.c | 2 +- .../interfaces/pthread_mutex_getprioceiling/1-1.c | 2 +- .../interfaces/pthread_mutex_getprioceiling/3-1.c | 2 +- .../interfaces/pthread_mutex_getprioceiling/3-2.c | 2 +- .../interfaces/pthread_mutex_getprioceiling/3-3.c | 2 +- .../interfaces/pthread_mutex_setprioceiling/1-1.c | 2 +- .../interfaces/pthread_mutexattr_setpshared/2-1.c | 2 +- .../interfaces/pthread_mutexattr_setpshared/3-1.c | 2 +- .../interfaces/pthread_mutexattr_setpshared/3-2.c | 2 +- .../conformance/interfaces/pthread_rwlock_rdlock/1-1.c | 2 +- .../conformance/interfaces/pthread_rwlock_rdlock/2-1.c | 2 +- .../conformance/interfaces/pthread_rwlock_rdlock/2-2.c | 2 +- .../conformance/interfaces/pthread_rwlock_rdlock/2-3.c | 2 +- .../conformance/interfaces/pthread_rwlock_rdlock/5-1.c | 4 ++-- .../interfaces/pthread_rwlock_timedrdlock/5-1.c | 2 +- .../interfaces/pthread_rwlock_timedrdlock/6-2.c | 10 +++++----- .../interfaces/pthread_rwlock_timedwrlock/5-1.c | 2 +- .../interfaces/pthread_rwlock_timedwrlock/6-2.c | 8 ++++---- .../conformance/interfaces/pthread_rwlock_unlock/3-1.c | 2 +- .../interfaces/pthread_rwlockattr_setpshared/1-1.c | 2 +- .../conformance/interfaces/pthread_spin_destroy/1-1.c | 2 +- .../conformance/interfaces/pthread_spin_lock/1-2.c | 2 +- .../conformance/interfaces/pthread_spin_unlock/1-1.c | 2 +- .../conformance/interfaces/pthread_spin_unlock/1-2.c | 2 +- .../conformance/interfaces/pthread_spin_unlock/3-1.c | 2 +- .../conformance/interfaces/sched_setparam/1-1.c | 2 +- .../conformance/interfaces/sched_setparam/20-1.c | 8 ++++---- .../conformance/interfaces/sched_setparam/21-1.c | 8 ++++---- .../conformance/interfaces/sched_setparam/21-2.c | 8 ++++---- .../conformance/interfaces/sched_setscheduler/15-1.c | 8 ++++---- .../conformance/interfaces/sched_setscheduler/15-2.c | 8 ++++---- .../conformance/interfaces/sched_setscheduler/22-1.c | 8 ++++---- .../conformance/interfaces/sched_setscheduler/22-2.c | 8 ++++---- .../conformance/interfaces/shm_unlink/11-1.c | 2 +- .../conformance/interfaces/sigismember/4-1.c | 2 +- .../conformance/interfaces/sigwait/4-1.c | 4 ++-- .../conformance/interfaces/testfrmw/testfrmw.c | 4 ++-- testcases/open_posix_testsuite/include/noatime.h | 2 +- .../stress/threads/fork/testfrmw.c | 2 +- testcases/open_posix_testsuite/stress/threads/helper.c | 2 +- .../stress/threads/pthread_cancel/testfrmw.c | 2 +- .../stress/threads/pthread_cond_wait/testfrmw.c | 2 +- .../stress/threads/pthread_create/testfrmw.c | 2 +- .../stress/threads/pthread_exit/testfrmw.c | 2 +- .../stress/threads/pthread_getschedparam/testfrmw.c | 2 +- .../stress/threads/pthread_kill/testfrmw.c | 2 +- .../stress/threads/pthread_mutex_trylock/testfrmw.c | 2 +- .../stress/threads/pthread_once/testfrmw.c | 2 +- .../stress/threads/pthread_self/testfrmw.c | 2 +- .../stress/threads/sem_getvalue/testfrmw.c | 2 +- .../stress/threads/sem_init/testfrmw.c | 2 +- .../stress/threads/sem_open/testfrmw.c | 2 +- 64 files changed, 97 insertions(+), 97 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/fork/19-1.c +3 -3
@@ -95,7 +95,7 @@ int main(void)if (mqa.mq_curmsgs !=1 ) {mq_close (mq);mq_unlink (queue_name); -printf ("The queue information does not show the new message" ); +printf ("The queue information does not show the new message\n" );return PTS_UNRESOLVED ; }
@@ -153,7 +153,7 @@ int main(void)if (!WIFEXITED (status) || (WEXITSTATUS (status) !=PTS_PASS )) {mq_close (mq);mq_unlink (queue_name); -printf ("Child exited abnormally" ); +printf ("Child exited abnormally\n" );return PTS_FAIL ; }
@@ -170,7 +170,7 @@ int main(void)if (mqa.mq_curmsgs !=0 ) {mq_close (mq);mq_unlink (queue_name); -printf ("The message received in child was not dequeued." ); +printf ("The message received in child was not dequeued.\n" );return PTS_FAIL ; }
testcases/open_posix_testsuite/conformance/interfaces/localtime/1-1.c +1 -1
@@ -24,7 +24,7 @@ int main(void) timeptr =localtime (¤t_time);if (timeptr !=NULL ) { -printf ("date: %s" , (asctime (localtime ((¤t_time))))); +printf ("date: %s, " , (asctime (localtime ((¤t_time)))));puts ("Test PASSED" );return PTS_PASS ; }else {
testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/speculative/3-2.c +1 -1
@@ -19,7 +19,7 @@#include "posixtest.h" #define TEST "3-2" -#define FUNCTION "pthread_attr_setschedpaarm" +#define FUNCTION "pthread_attr_setschedparam"#define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": "#define RRPOLICY SCHED_RR
testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_destroy/2-1.c +1 -1
@@ -53,7 +53,7 @@ static void *fn_chld(void *arg)else if (rc !=0 )perror ("child: pthread_barrier_wait" );else -printf ("child: pthread_barrier_wait returned success" ); +printf ("child: pthread_barrier_wait returned success\n" ); thread_state =EXITING_THREAD ;return arg;
testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/4-1.c +1 -1
@@ -114,7 +114,7 @@ int main(void) rc =pthread_barrier_init (&barrier,NULL ,2 );if (rc ==EBUSY ) { -printf ("main: pthread_barrier_init() correctly got EBUSY" ); +printf ("main: pthread_barrier_init() correctly got EBUSY\n" );printf ("Test PASSED\n" ); }else {printf ("main: got return code: %d, %s\n" , rc,strerror (rc));
testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/1-1.c +1 -1
@@ -139,7 +139,7 @@ int main(void) }if (pthread_barrier_destroy (&barrier) !=0 ) { -printf ("Error at pthread_barrier_destroy()" ); +printf ("Error at pthread_barrier_destroy()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/2-1.c +1 -1
@@ -112,7 +112,7 @@ int main(void) }if (pthread_barrier_destroy (&barrier) !=0 ) { -printf ("Error at pthread_barrier_destroy()" ); +printf ("Error at pthread_barrier_destroy()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-1.c +1 -1
@@ -169,7 +169,7 @@ int main(void) }if (pthread_barrier_destroy (&barrier) !=0 ) { -printf ("Error at pthread_barrier_destroy()" ); +printf ("Error at pthread_barrier_destroy()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-2.c +1 -1
@@ -161,7 +161,7 @@ int main(void) }if (pthread_barrier_destroy (&barrier) !=0 ) { -printf ("Error at pthread_barrier_destroy()" ); +printf ("Error at pthread_barrier_destroy()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/1-1.c +1 -1
@@ -49,7 +49,7 @@ int main(void) rc =pthread_barrierattr_destroy (&ba);if (rc !=0 ) {printf ("Error at pthread_barrierattr_destroy() " -"return code: %d, %s" , rc,strerror (rc)); +"return code: %d, %s\n" , rc,strerror (rc));return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/2-1.c +1 -1
@@ -198,7 +198,7 @@ int main(void)/* Cleanup */ if (pthread_barrier_destroy (barrier) !=0 ) { -printf ("Error at pthread_barrier_destroy()" ); +printf ("Error at pthread_barrier_destroy()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/1-1.c +1 -1
@@ -53,7 +53,7 @@ int main(void) rc =pthread_barrierattr_destroy (&ba);if (rc !=0 ) {printf ("Error at pthread_barrierattr_destroy() " -"return code: %d, %s" , rc,strerror (rc)); +"return code: %d, %s\n" , rc,strerror (rc));return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/2-1.c +1 -1
@@ -50,7 +50,7 @@ int main(void) rc =pthread_barrierattr_destroy (&ba);if (rc !=0 ) {printf ("Error at pthread_barrierattr_destroy() " -"return code: %d, %s" , rc,strerror (rc)); +"return code: %d, %s\n" , rc,strerror (rc));return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/1-1.c +1 -1
@@ -71,7 +71,7 @@ int main(void)printf ("Prioceiling returned: %d\n" , prioceiling);return PTS_PASS ;#else -printf ("pthread_mutex_getprioceiling not supported" ); +printf ("pthread_mutex_getprioceiling not supported\n" );return PTS_UNSUPPORTED ;#endif
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c +1 -1
@@ -65,7 +65,7 @@ int main(void)return (error ==EINVAL ?PTS_PASS :PTS_FAIL );#else -printf ("pthread_mutex_getprioceiling not supported" ); +printf ("pthread_mutex_getprioceiling not supported\n" );return PTS_UNSUPPORTED ;#endif
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c +1 -1
@@ -78,7 +78,7 @@ int main(void)return (error ==EINVAL ?PTS_PASS :PTS_FAIL );#else -printf ("pthread_mutex_getprioceiling not supported" ); +printf ("pthread_mutex_getprioceiling not supported\n" );return PTS_UNSUPPORTED ;#endif
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c +1 -1
@@ -80,7 +80,7 @@ int main(void)return (error ==EINVAL ?PTS_PASS :PTS_UNRESOLVED );#else -printf ("pthread_mutex_getprioceiling not supported" ); +printf ("pthread_mutex_getprioceiling not supported\n" );return PTS_UNSUPPORTED ;#endif
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_setprioceiling/1-1.c +1 -1
@@ -71,7 +71,7 @@ int main(void)printf ("Prioceiling returned: %d\n" , prioceiling);return PTS_PASS ;#else -printf ("pthread_mutex_getprioceiling not supported" ); +printf ("pthread_mutex_getprioceiling not supported\n" );return PTS_UNSUPPORTED ;#endif
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/2-1.c +1 -1
@@ -42,7 +42,7 @@ int main(void)/* Set the attribute to PTHREAD_PROCESS_PRIVATE. */ ret =pthread_mutexattr_setpshared (&mta,PTHREAD_PROCESS_PRIVATE );if (ret !=0 ) { -printf ("Test FAILED: Expected return code 0, got: %d" , ret); +printf ("Test FAILED: Expected return code 0, got: %d\n" , ret);return PTS_FAIL ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/3-1.c +1 -1
@@ -44,7 +44,7 @@ int main(void)return PTS_PASS ; } -printf ("Test FAILED: Expected return code 0 or EINVAL, got: %d" , +printf ("Test FAILED: Expected return code 0 or EINVAL, got: %d\n" , ret);return PTS_FAIL ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/3-2.c +1 -1
@@ -47,7 +47,7 @@ int main(void)return PTS_PASS ; } -printf ("Test FAILED: Expected return code 0 or EINVAL, got: %d" , +printf ("Test FAILED: Expected return code 0 or EINVAL, got: %d\n" , ret);return PTS_FAIL ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/1-1.c +1 -1
@@ -177,7 +177,7 @@ int main(void) }if (pthread_rwlock_destroy (&rwlock) !=0 ) { -printf ("Error at pthread_rwlockattr_destroy()" ); +printf ("Error at pthread_rwlockattr_destroy()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c +1 -1
@@ -260,7 +260,7 @@ int main(void) }if (pthread_rwlock_destroy (&rwlock) !=0 ) { -printf ("Error at pthread_rwlockattr_destroy()" ); +printf ("Error at pthread_rwlockattr_destroy()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-2.c +1 -1
@@ -259,7 +259,7 @@ int main(void) }if (pthread_rwlock_destroy (&rwlock) !=0 ) { -printf ("Error at pthread_rwlockattr_destroy()" ); +printf ("Error at pthread_rwlockattr_destroy()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-3.c +1 -1
@@ -245,7 +245,7 @@ int main(void) }if (pthread_rwlock_destroy (&rwlock) !=0 ) { -printf ("Error at pthread_rwlockattr_destroy()" ); +printf ("Error at pthread_rwlockattr_destroy()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/5-1.c +2 -2
@@ -46,14 +46,14 @@ int main(void)for (i =0 ; i <COUNT ; i++) {if (pthread_rwlock_unlock (&rwlock) !=0 ) {printf - ("Test FAILED: main cannot unlock rwlock number %d" , + ("Test FAILED: main cannot unlock rwlock number %d\n" , i);return PTS_FAIL ; } }if (pthread_rwlock_destroy (&rwlock) !=0 ) { -printf ("Error at pthread_rwlockattr_destroy()" ); +printf ("Error at pthread_rwlockattr_destroy()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/5-1.c +1 -1
@@ -74,7 +74,7 @@ static void *fn_rd_1(void *arg PTS_ATTRIBUTE_UNUSED) }if (pthread_rwlock_destroy (&rwlock) !=0 ) { -printf ("thread1: Error at pthread_rwlockattr_destroy()" ); +printf ("thread1: Error at pthread_rwlockattr_destroy()\n" );exit (PTS_UNRESOLVED ); } thread_state =EXITING_THREAD ;
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/6-2.c +5 -5
@@ -106,10 +106,10 @@ static void *th_fn(void *arg PTS_ATTRIBUTE_UNUSED)printf ("thread: correctly acquired read lock\n" ); expired =0 ; }else if (rc ==ETIMEDOUT ) { -printf ("thread: timer expired, did not acquire read lock" ); +printf ("thread: timer expired, did not acquire read lock\n" ); expired =1 ; }else { -printf ("Error at pthread_rwlock_timedrdlock()" ); +printf ("Error at pthread_rwlock_timedrdlock()\n" );exit (PTS_UNRESOLVED ); }
@@ -155,7 +155,7 @@ int main(void)printf ("main: fire SIGUSR1 to thread\n" );if (pthread_kill (sig_thread,SIGUSR1 ) !=0 ) { -printf ("Error in pthread_kill()" ); +printf ("Error in pthread_kill()\n" );exit (PTS_UNRESOLVED ); }
@@ -206,12 +206,12 @@ int main(void) }if (pthread_join (sig_thread,NULL ) !=0 ) { -printf ("Error at pthread_join()" ); +printf ("Error at pthread_join()\n" );return PTS_UNRESOLVED ; }if (pthread_rwlock_destroy (&rwlock) !=0 ) { -printf ("Error at pthread_destroy()" ); +printf ("Error at pthread_destroy()\n" );exit (PTS_UNRESOLVED ); }
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/5-1.c +1 -1
@@ -81,7 +81,7 @@ static void *fn_wr_1(void *arg PTS_ATTRIBUTE_UNUSED) }if (pthread_rwlock_destroy (&rwlock) !=0 ) { -printf ("thread1: Error at pthread_rwlockattr_destroy()" ); +printf ("thread1: Error at pthread_rwlockattr_destroy()\n" );exit (PTS_UNRESOLVED ); } thread_state =EXITING_THREAD ;
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-2.c +3 -3
@@ -106,7 +106,7 @@ static void *th_fn(void *arg PTS_ATTRIBUTE_UNUSED)printf ("thread: correctly acquired write lock\n" ); expired =0 ; }else if (rc ==ETIMEDOUT ) { -printf ("thread: timer expired, did not acquire write lock" ); +printf ("thread: timer expired, did not acquire write lock\n" ); expired =1 ; }else {printf ("Error %d at pthread_rwlock_timedwrlock()\n" , rc);
@@ -155,7 +155,7 @@ int main(void)printf ("main: fire SIGUSR1 to thread\n" );if (pthread_kill (sig_thread,SIGUSR1 ) !=0 ) { -printf ("Error in pthread_kill()" ); +printf ("Error in pthread_kill()\n" );exit (PTS_UNRESOLVED ); }
@@ -206,12 +206,12 @@ int main(void) }if (pthread_join (sig_thread,NULL ) !=0 ) { -printf ("Error at pthread_join()" ); +printf ("Error at pthread_join()\n" );return PTS_UNRESOLVED ;
}
if (pthread_rwlock_destroy(&rwlock) != 0) {
- printf("Error at pthread_destroy()");
+ printf("Error at pthread_destroy()\n");
exit(PTS_UNRESOLVED);
}
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/3-1.c +1 -1
@@ -365,7 +365,7 @@ int main(void) }if (pthread_rwlock_destroy (&rwlock) !=0 ) { -printf ("Error at pthread_rwlockattr_destroy()" ); +printf ("Error at pthread_rwlockattr_destroy()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_setpshared/1-1.c +1 -1
@@ -78,7 +78,7 @@ int main(void) }if (pthread_rwlockattr_destroy (&rwla) !=0 ) { -printf ("Error at pthread_rwlockattr_destroy()" ); +printf ("Error at pthread_rwlockattr_destroy()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy/1-1.c +1 -1
@@ -56,7 +56,7 @@ int main(void)printf ("main: destroy spin lock\n" ); rc =pthread_spin_destroy (&spinlock);if (rc !=0 ) { -printf ("Test FAILED: Error at pthread_spin_destroy()" +printf ("Test FAILED: Error at pthread_spin_destroy(), " "Return code : %d\n" , rc);return PTS_FAIL ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c +1 -1
@@ -142,7 +142,7 @@ int main(void)/* Destroy the spinlock */ if (pthread_spin_destroy (&spinlock) !=0 ) { -printf ("Error at pthread_spin_destroy()" ); +printf ("Error at pthread_spin_destroy()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-1.c +1 -1
@@ -118,7 +118,7 @@ int main(void) }if (pthread_spin_destroy (&spinlock) !=0 ) { -printf ("Error at pthread_spin_destroy()" ); +printf ("Error at pthread_spin_destroy()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-2.c +1 -1
@@ -137,7 +137,7 @@ int main(void) }if (pthread_spin_destroy (&spinlock) !=0 ) { -printf ("Error at pthread_spin_destroy()" ); +printf ("Error at pthread_spin_destroy()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/3-1.c +1 -1
@@ -66,7 +66,7 @@ static void *fn_chld(void *arg)pthread_spin_unlock (&spinlock);if (pthread_spin_destroy (&spinlock) !=0 ) { -printf ("Error at pthread_spin_destroy()" ); +printf ("Error@pthread_spin_destroy()\n" );exit (PTS_UNRESOLVED ); }
testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/1-1.c +1 -1
@@ -106,7 +106,7 @@ int main(void) result =sched_setparam (child_pid, ¶m);if (result ==0 && param.sched_priority == new_priority) { -printf ("Test PASSED" ); +printf ("Test PASSED\n" );kill (child_pid,SIGUSR1 );return PTS_PASS ; }
testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/20-1.c +4 -4
@@ -46,7 +46,7 @@ int main(void) sched_get_priority_min(policy) : max_priority;if (pthread_attr_init (&attr) !=0 ) { -printf ("An error occurs when calling pthread_attr_init()" ); +printf ("An error occurs when calling pthread_attr_init()\n" );return PTS_UNRESOLVED ; } result =pthread_attr_setscope (&attr,PTHREAD_SCOPE_PROCESS );
@@ -54,11 +54,11 @@ int main(void)printf ("Process contention scope threads are not supported.\n" );return PTS_UNSUPPORTED ; }else if (result !=0 ) { -printf ("An error occurs when calling pthread_attr_setscope()" ); +printf ("An error occurs when calling pthread_attr_setscope()\n" );return PTS_UNRESOLVED ; }if (pthread_create (&tid, &attr, runner,NULL ) !=0 ) { -printf ("An error occurs when calling pthread_create()" ); +printf ("An error occurs when calling pthread_create()\n" );return PTS_UNRESOLVED ; }
@@ -69,7 +69,7 @@ int main(void) }if (pthread_getschedparam (tid, &policy, ¶m) !=0 ) { -printf ("An error occurs when calling pthread_getschedparam()" ); +printf ("An error occurs when calling pthread_getschedparam()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/21-1.c +4 -4
@@ -50,7 +50,7 @@ int main(void) }if (pthread_attr_init (&attr) !=0 ) { -printf ("An error occurs when calling pthread_attr_init()" ); +printf ("An error occurs when calling pthread_attr_init()\n" );return PTS_UNRESOLVED ; } result =pthread_attr_setscope (&attr,PTHREAD_SCOPE_PROCESS );
@@ -58,16 +58,16 @@ int main(void)printf ("Process contention scope threads are not supported.\n" );return PTS_UNSUPPORTED ; }else if (result !=0 ) { -printf ("An error occurs when calling pthread_attr_setscope()" ); +printf ("An error occurs when calling pthread_attr_setscope()\n" );return PTS_UNRESOLVED ; }if (pthread_create (&tid, &attr, runner,NULL ) !=0 ) { -printf ("An error occurs when calling pthread_create()" ); +printf ("An error occurs when calling pthread_create()\n" );return PTS_UNRESOLVED ; }if (pthread_getschedparam (tid, &policy, ¶m) !=0 ) { -printf ("An error occurs when calling pthread_getschedparam()" ); +printf ("An error occurs when calling pthread_getschedparam()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/21-2.c +4 -4
@@ -50,7 +50,7 @@ int main(void) }if (pthread_attr_init (&attr) !=0 ) { -printf ("An error occurs when calling pthread_attr_init()" ); +printf ("An error occurs when calling pthread_attr_init()\n" );return PTS_UNRESOLVED ; } result =pthread_attr_setscope (&attr,PTHREAD_SCOPE_PROCESS );
@@ -58,16 +58,16 @@ int main(void)printf ("Process contention scope threads are not supported.\n" );return PTS_UNSUPPORTED ; }else if (result !=0 ) { -printf ("An error occurs when calling pthread_attr_setscope()" ); +printf ("An error occurs when calling pthread_attr_setscope()\n" );return PTS_UNRESOLVED ; }if (pthread_create (&tid, &attr, runner,NULL ) !=0 ) { -printf ("An error occurs when calling pthread_create()" ); +printf ("An error occurs when calling pthread_create()\n" );return PTS_UNRESOLVED ; }if (pthread_getschedparam (tid, &policy, ¶m) !=0 ) { -printf ("An error occurs when calling pthread_getschedparam()" ); +printf ("An error occurs when calling pthread_getschedparam()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/15-1.c +4 -4
@@ -40,7 +40,7 @@ int main(void) SCHED_RR :SCHED_FIFO ;if (pthread_attr_init (&attr) !=0 ) { -printf ("An error occurs when calling pthread_attr_init()" ); +printf ("An error occurs when calling pthread_attr_init()\n" );return PTS_UNRESOLVED ; } result =pthread_attr_setscope (&attr,PTHREAD_SCOPE_PROCESS );
@@ -48,11 +48,11 @@ int main(void)printf ("Process contention scope threads are not supported.\n" );return PTS_UNSUPPORTED ; }else if (result !=0 ) { -printf ("An error occurs when calling pthread_attr_setscope()" ); +printf ("An error occurs when calling pthread_attr_setscope()\n" );return PTS_UNRESOLVED ; }if (pthread_create (&tid, &attr, runner,NULL ) !=0 ) { -printf ("An error occurs when calling pthread_create()" ); +printf ("An error occurs when calling pthread_create()\n" );return PTS_UNRESOLVED ; }
@@ -68,7 +68,7 @@ int main(void) }if (pthread_getschedparam (tid, &policy, ¶m) !=0 ) { -printf ("An error occurs when calling pthread_getschedparam()" ); +printf ("An error occurs when calling pthread_getschedparam()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/15-2.c +4 -4
@@ -46,7 +46,7 @@ int main(void) sched_get_priority_min(SCHED_FIFO) : max_priority;if (pthread_attr_init (&attr) !=0 ) { -printf ("An error occurs when calling pthread_attr_init()" ); +printf ("An error occurs when calling pthread_attr_init()\n" );return PTS_UNRESOLVED ; } result =pthread_attr_setscope (&attr,PTHREAD_SCOPE_PROCESS );
@@ -54,11 +54,11 @@ int main(void)printf ("Process contention scope threads are not supported.\n" );return PTS_UNSUPPORTED ; }else if (result !=0 ) { -printf ("An error occurs when calling pthread_attr_setscope()" ); +printf ("An error occurs when calling pthread_attr_setscope()\n" );return PTS_UNRESOLVED ; }if (pthread_create (&tid, &attr, runner,NULL ) !=0 ) { -printf ("An error occurs when calling pthread_create()" ); +printf ("An error occurs when calling pthread_create()\n" );return PTS_UNRESOLVED ; }
@@ -74,7 +74,7 @@ int main(void) }if (pthread_getschedparam (tid, &policy, ¶m) !=0 ) { -printf ("An error occurs when calling pthread_getschedparam()" ); +printf ("An error occurs when calling pthread_getschedparam()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/22-1.c +4 -4
@@ -56,7 +56,7 @@ int main(void) }if (pthread_attr_init (&attr) !=0 ) { -printf ("An error occurs when calling pthread_attr_init()" ); +printf ("An error occurs when calling pthread_attr_init()\n" );return PTS_UNRESOLVED ; } result =pthread_attr_setscope (&attr,PTHREAD_SCOPE_PROCESS );
@@ -64,16 +64,16 @@ int main(void)printf ("Process contention scope threads are not supported.\n" );return PTS_UNSUPPORTED ; }else if (result !=0 ) { -printf ("An error occurs when calling pthread_attr_setscope()" ); +printf ("An error occurs when calling pthread_attr_setscope()\n" );return PTS_UNRESOLVED ; }if (pthread_create (&tid, &attr, runner,NULL ) !=0 ) { -printf ("An error occurs when calling pthread_create()" ); +printf ("An error occurs when calling pthread_create()\n" );return PTS_UNRESOLVED ; }if (pthread_getschedparam (tid, &policy, ¶m) !=0 ) { -printf ("An error occurs when calling pthread_getschedparam()" ); +printf ("An error occurs when calling pthread_getschedparam()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/22-2.c +4 -4
@@ -55,7 +55,7 @@ int main(void) }if (pthread_attr_init (&attr) !=0 ) { -printf ("An error occurs when calling pthread_attr_init()" ); +printf ("An error occurs when calling pthread_attr_init()\n" );return PTS_UNRESOLVED ; } result =pthread_attr_setscope (&attr,PTHREAD_SCOPE_PROCESS );
@@ -63,16 +63,16 @@ int main(void)printf ("Process contention scope threads are not supported.\n" );return PTS_UNSUPPORTED ; }else if (result !=0 ) { -printf ("An error occurs when calling pthread_attr_setscope()" ); +printf ("An error occurs when calling pthread_attr_setscope()\n" );return PTS_UNRESOLVED ; }if (pthread_create (&tid, &attr, runner,NULL ) !=0 ) { -printf ("An error occurs when calling pthread_create()" ); +printf ("An error occurs when calling pthread_create()\n" );return PTS_UNRESOLVED ; }if (pthread_getschedparam (tid, &policy, ¶m) !=0 ) { -printf ("An error occurs when calling pthread_getschedparam()" ); +printf ("An error occurs when calling pthread_getschedparam()\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/11-1.c +1 -1
@@ -35,7 +35,7 @@ int main(void)return PTS_UNRESOLVED ; } -printf ("shm_unlink() success." ); +printf ("shm_unlink() success.\n" );return PTS_FAIL ; }
testcases/open_posix_testsuite/conformance/interfaces/sigismember/4-1.c +1 -1
@@ -24,7 +24,7 @@ int main(void) }if (sigismember (&signalset,SIGABRT ) !=0 ) { -printf ("sigismember dit not return 0" ); +printf ("sigismember dit not return 0\n" );return PTS_FAIL ; }
testcases/open_posix_testsuite/conformance/interfaces/sigwait/4-1.c +2 -2
@@ -49,7 +49,7 @@ int main(void)/* Read clock */ if (gettimeofday (&tv_ref,NULL ) !=0 ) { -printf ("Failed to get time of day" ); +printf ("Failed to get time of day\n" );return PTS_UNRESOLVED ; }
@@ -65,7 +65,7 @@ int main(void)/* Re-read clock */ if (gettimeofday (&tv_cur,NULL ) !=0 ) { -printf ("Failed to get time of day" ); +printf ("Failed to get time of day\n" );return PTS_UNRESOLVED ; }
testcases/open_posix_testsuite/conformance/interfaces/testfrmw/testfrmw.c +2 -2
@@ -51,9 +51,9 @@ static void output(char *string, ...) nw =time (NULL ); now =localtime (&nw);if (now ==NULL ) -printf ("[??:??:??]" ); +printf ("[??:??:??]\n" );else -printf ("[%2.2d:%2.2d:%2.2d]" , +printf ("[%2.2d:%2.2d:%2.2d]\n" , now->tm_hour, now->tm_min, now->tm_sec);va_start (ap, string);vprintf (string, ap);
testcases/open_posix_testsuite/include/noatime.h +1 -1
@@ -79,7 +79,7 @@ int mounted_noatime(const char *path)struct statfs _statfs;if (statfs (path, &_statfs) ==-1 ) { -printf ("statfs for %s failed: %s" , path,strerror (errno)); +printf ("statfs for %s failed: %s\n" , path,strerror (errno));return -1 ; }
testcases/open_posix_testsuite/stress/threads/fork/testfrmw.c +1 -1
@@ -56,7 +56,7 @@ static void output(char *string, ...)if (now ==NULL )printf (ts);else -printf ("[%2.2d:%2.2d:%2.2d]" , now->tm_hour, now->tm_min, +printf ("[%2.2d:%2.2d:%2.2d]\n" , now->tm_hour, now->tm_min, now->tm_sec);va_start (ap, string);vprintf (string, ap);
testcases/open_posix_testsuite/stress/threads/helper.c +1 -1
@@ -165,7 +165,7 @@ int main(int argc, char *argv[])if (now ==NULL )printf (ts);else -printf ("[%2.2d:%2.2d:%2.2d]" , now->tm_hour, now->tm_min, +printf ("[%2.2d:%2.2d:%2.2d]\n" , now->tm_hour, now->tm_min, now->tm_sec);if (!WIFEXITED (status)) {printf ("The stress sample did not exit\n" );
testcases/open_posix_testsuite/stress/threads/pthread_cancel/testfrmw.c +1 -1
@@ -56,7 +56,7 @@ static void output(char *string, ...)if (now ==NULL )printf (ts);else -printf ("[%2.2d:%2.2d:%2.2d]" , now->tm_hour, now->tm_min, +printf ("[%2.2d:%2.2d:%2.2d]\n" , now->tm_hour, now->tm_min, now->tm_sec);va_start (ap, string);vprintf (string, ap);
testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/testfrmw.c +1 -1
@@ -56,7 +56,7 @@ static void output(char *string, ...)if (now ==NULL )printf (ts);else -printf ("[%2.2d:%2.2d:%2.2d]" , now->tm_hour, now->tm_min, +printf ("[%2.2d:%2.2d:%2.2d]\n" , now->tm_hour, now->tm_min, now->tm_sec);va_start (ap, string);vprintf (string, ap);
testcases/open_posix_testsuite/stress/threads/pthread_create/testfrmw.c +1 -1
@@ -56,7 +56,7 @@ static void output(char *string, ...)if (now ==NULL )printf (ts);else -printf ("[%2.2d:%2.2d:%2.2d]" , now->tm_hour, now->tm_min, +printf ("[%2.2d:%2.2d:%2.2d]\n" , now->tm_hour, now->tm_min, now->tm_sec);va_start (ap, string);vprintf (string, ap);
testcases/open_posix_testsuite/stress/threads/pthread_exit/testfrmw.c +1 -1
@@ -56,7 +56,7 @@ static void output(char *string, ...)if (now ==NULL )printf (ts);else -printf ("[%2.2d:%2.2d:%2.2d]" , now->tm_hour, now->tm_min, +printf ("[%2.2d:%2.2d:%2.2d]\n" , now->tm_hour, now->tm_min, now->tm_sec);va_start (ap, string);vprintf (string, ap);
testcases/open_posix_testsuite/stress/threads/pthread_getschedparam/testfrmw.c +1 -1
@@ -56,7 +56,7 @@ static void output(char *string, ...)if (now ==NULL )printf (ts);else -printf ("[%2.2d:%2.2d:%2.2d]" , now->tm_hour, now->tm_min, +printf ("[%2.2d:%2.2d:%2.2d]\n" , now->tm_hour, now->tm_min, now->tm_sec);va_start (ap, string);vprintf (string, ap);
testcases/open_posix_testsuite/stress/threads/pthread_kill/testfrmw.c +1 -1
@@ -56,7 +56,7 @@ static void output(char *string, ...)if (now ==NULL )printf (ts);else -printf ("[%2.2d:%2.2d:%2.2d]" , now->tm_hour, now->tm_min, +printf ("[%2.2d:%2.2d:%2.2d]\n" , now->tm_hour, now->tm_min, now->tm_sec);va_start (ap, string);vprintf (string, ap);
testcases/open_posix_testsuite/stress/threads/pthread_mutex_trylock/testfrmw.c +1 -1
@@ -56,7 +56,7 @@ static void output(char *string, ...)if (now ==NULL )printf (ts);else -printf ("[%2.2d:%2.2d:%2.2d]" , now->tm_hour, now->tm_min, +printf ("[%2.2d:%2.2d:%2.2d]\n" , now->tm_hour, now->tm_min, now->tm_sec);va_start (ap, string);vprintf (string, ap);
testcases/open_posix_testsuite/stress/threads/pthread_once/testfrmw.c +1 -1
@@ -56,7 +56,7 @@ static void output(char *string, ...)if (now ==NULL )printf (ts);else -printf ("[%2.2d:%2.2d:%2.2d]" , now->tm_hour, now->tm_min, +printf ("[%2.2d:%2.2d:%2.2d]\n" , now->tm_hour, now->tm_min, now->tm_sec);va_start (ap, string);vprintf (string, ap);
testcases/open_posix_testsuite/stress/threads/pthread_self/testfrmw.c +1 -1
@@ -56,7 +56,7 @@ static void output(char *string, ...)if (now ==NULL )printf (ts);else -printf ("[%2.2d:%2.2d:%2.2d]" , now->tm_hour, now->tm_min, +printf ("[%2.2d:%2.2d:%2.2d]\n" , now->tm_hour, now->tm_min, now->tm_sec);va_start (ap, string);vprintf (string, ap);
testcases/open_posix_testsuite/stress/threads/sem_getvalue/testfrmw.c +1 -1
@@ -56,7 +56,7 @@ static void output(char *string, ...)if (now ==NULL )printf (ts);else -printf ("[%2.2d:%2.2d:%2.2d]" , now->tm_hour, now->tm_min, +printf ("[%2.2d:%2.2d:%2.2d]\n" , now->tm_hour, now->tm_min, now->tm_sec);va_start (ap, string);vprintf (string, ap);
testcases/open_posix_testsuite/stress/threads/sem_init/testfrmw.c +1 -1
@@ -56,7 +56,7 @@ static void output(char *string, ...)if (now ==NULL )printf (ts);else -printf ("[%2.2d:%2.2d:%2.2d]" , now->tm_hour, now->tm_min, +printf ("[%2.2d:%2.2d:%2.2d]\n" , now->tm_hour, now->tm_min, now->tm_sec);va_start (ap, string);vprintf (string, ap);
testcases/open_posix_testsuite/stress/threads/sem_open/testfrmw.c +1 -1
@@ -56,7 +56,7 @@ static void output(char *string, ...)if (now ==NULL )printf (ts);else -printf ("[%2.2d:%2.2d:%2.2d]" , now->tm_hour, now->tm_min, +printf ("[%2.2d:%2.2d:%2.2d]\n" , now->tm_hour, now->tm_min, now->tm_sec);va_start (ap, string);vprintf (string, ap);
--
2.17.1
PATCH 1/1 openposix: Add '\n' at the end of printf
Hi Zhao,
Quoted 5 lines
We need to add '\n' at the end of printf, or the print string may be orderless with error output.
For all of the files of dir testcases/open_posix_testsuite/* which referenced.
I applied your patch with patch program (corrupted to be applied by git am) and merged. Thanks!
Kind regards,
Petr