From aea879534651059ad856ff67e01059fcd9e87716 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 8 Apr 2010 15:34:12 +0000 Subject: [PATCH] Be more generous with the semaphore name array size. Large enough PIDs would lead to overwriting its bounds. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36084 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../conformance/interfaces/sem_close/1-1.c | 8 ++++---- .../conformance/interfaces/sem_close/2-1.c | 12 ++++++------ .../conformance/interfaces/sem_close/3-1.c | 12 ++++++------ .../conformance/interfaces/sem_getvalue/1-1.c | 10 +++++----- .../conformance/interfaces/sem_getvalue/2-1.c | 8 ++++---- .../conformance/interfaces/sem_getvalue/4-1.c | 6 +++--- .../conformance/interfaces/sem_getvalue/5-1.c | 12 ++++++------ .../conformance/interfaces/sem_open/1-4.c | 10 +++++----- .../conformance/interfaces/sem_open/5-1.c | 4 ++-- .../conformance/interfaces/sem_open/6-1.c | 4 ++-- .../conformance/interfaces/sem_post/1-1.c | 10 +++++----- .../conformance/interfaces/sem_post/1-2.c | 10 +++++----- .../conformance/interfaces/sem_post/2-1.c | 10 +++++----- .../conformance/interfaces/sem_post/4-1.c | 8 ++++---- .../conformance/interfaces/sem_post/5-1.c | 4 ++-- .../conformance/interfaces/sem_post/6-1.c | 4 ++-- .../conformance/interfaces/sem_unlink/1-1.c | 6 +++--- .../conformance/interfaces/sem_unlink/2-1.c | 6 +++--- .../conformance/interfaces/sem_wait/1-1.c | 10 +++++----- .../conformance/interfaces/sem_wait/1-2.c | 12 ++++++------ .../conformance/interfaces/sem_wait/11-1.c | 12 ++++++------ .../conformance/interfaces/sem_wait/12-1.c | 8 ++++---- .../conformance/interfaces/sem_wait/3-1.c | 10 +++++----- .../conformance/interfaces/sem_wait/5-1.c | 8 ++++---- .../conformance/interfaces/sem_wait/7-1.c | 2 +- 25 files changed, 103 insertions(+), 103 deletions(-) diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_close/1-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_close/1-1.c index 63d981689e..ef82c6c947 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_close/1-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_close/1-1.c @@ -1,8 +1,8 @@ /* Copyright (c) 2002, Intel Corporation. All rights reserved. Created by: majid.awad REMOVE-THIS AT intel DOT com - This file is licensed under the GPL license. For the full content - of this license, see the COPYING file at the top level of this + This file is licensed under the GPL license. For the full content + of this license, see the COPYING file at the top level of this source tree. */ @@ -28,12 +28,12 @@ int main() { sem_t *mysemp; - char semname[20]; + char semname[50]; sprintf(semname, "/" FUNCTION "_" TEST "_%ld", (long)getpid()); mysemp = sem_open(semname, O_CREAT, 0700, 1) ; - if (mysemp == SEM_FAILED) { + if (mysemp == SEM_FAILED) { perror(ERROR_PREFIX "sem_open"); return PTS_UNRESOLVED; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_close/2-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_close/2-1.c index 1b56c6807d..4d40cfdcfc 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_close/2-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_close/2-1.c @@ -1,7 +1,7 @@ /* Copyright (c) 2002, Intel Corporation. All rights reserved. Created by: majid.awad REMOVE-THIS AT intel DOT com - This file is licensed under the GPL license. For the full content - of this license, see the COPYING file at the top level of this + This file is licensed under the GPL license. For the full content + of this license, see the COPYING file at the top level of this source tree. */ @@ -28,13 +28,13 @@ int main() { sem_t *mysemp; - char semname[20]; + char semname[50]; sprintf(semname, "/" FUNCTION "_" TEST "_%ld", (long)getpid()); mysemp = sem_open(semname, O_CREAT, 0777, 1); - if (mysemp == SEM_FAILED ) { + if (mysemp == SEM_FAILED ) { perror(ERROR_PREFIX "sem_open"); return PTS_UNRESOLVED; } @@ -47,12 +47,12 @@ int main() /* Make mysemp available for reuse */ mysemp = sem_open(semname, O_CREAT, 0777, 1); - if (mysemp == SEM_FAILED ) { + if (mysemp == SEM_FAILED ) { perror(ERROR_PREFIX "sem_open"); return PTS_UNRESOLVED; } - + if ((sem_close(mysemp)) == 0) { puts("TEST PASSED"); sem_unlink(semname); diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_close/3-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_close/3-1.c index 29773fc5c6..3991291858 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_close/3-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_close/3-1.c @@ -1,13 +1,13 @@ /* Copyright (c) 2002, Intel Corporation. All rights reserved. Created by: majid.awad REMOVE-THIS AT intel DOT com - This file is licensed under the GPL license. For the full content - of this license, see the COPYING file at the top level of this + This file is licensed under the GPL license. For the full content + of this license, see the COPYING file at the top level of this source tree. */ /* - sem_close will have no effect on the state of the semaphore if + sem_close will have no effect on the state of the semaphore if sem_unlink has been unsuccessful. */ @@ -30,12 +30,12 @@ int main() { sem_t *mysemp; - char semname[20]; + char semname[50]; sprintf(semname, "/" FUNCTION "_" TEST "_%ld", (long)getpid()); mysemp = sem_open(semname, O_CREAT, 0444, 1) ; - if (mysemp == SEM_FAILED) { + if (mysemp == SEM_FAILED) { perror(ERROR_PREFIX "sem_open"); return PTS_UNRESOLVED; } @@ -47,7 +47,7 @@ int main() } puts("TEST PASSED"); return PTS_PASS; - } else { + } else { puts("TEST FAILED"); return PTS_FAIL; diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_getvalue/1-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_getvalue/1-1.c index 7fd17df079..1fb3702320 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_getvalue/1-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_getvalue/1-1.c @@ -1,14 +1,14 @@ /* Copyright (c) 2003, Intel Corporation. All rights reserved. Created by: majid.awad REMOVE-THIS AT intel DOT com - This file is licensed under the GPL license. For the full content - of this license, see the COPYING file at the top level of this + This file is licensed under the GPL license. For the full content + of this license, see the COPYING file at the top level of this source tree. */ /* * This test case will call sem_getvalue to update the location referenced - * by the semaphpre without effecting the state of the semaphore. The + * by the semaphpre without effecting the state of the semaphore. The * updated value represents the actual semaphore value when it was called. */ @@ -29,7 +29,7 @@ int main() { - char semname[20]; + char semname[50]; sem_t *mysemp; int val; @@ -44,7 +44,7 @@ int main() { if( sem_getvalue(mysemp, &val) == -1 ) { perror(ERROR_PREFIX "sem_getvalue"); - return PTS_UNRESOLVED; + return PTS_UNRESOLVED; } /* diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_getvalue/2-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_getvalue/2-1.c index 86ee52feca..61aa02642f 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_getvalue/2-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_getvalue/2-1.c @@ -1,8 +1,8 @@ /* Copyright (c) 2003, Intel Corporation. All rights reserved. Created by: majid.awad REMOVE-THIS AT intel DOT com - This file is licensed under the GPL license. For the full content - of this license, see the COPYING file at the top level of this + This file is licensed under the GPL license. For the full content + of this license, see the COPYING file at the top level of this source tree. */ @@ -26,7 +26,7 @@ int main() { - char semname[20]; + char semname[50]; sem_t *mysemp; int val; @@ -47,7 +47,7 @@ int main() { if( sem_getvalue(mysemp, &val) < 0 ) { perror(ERROR_PREFIX "sem_getvalue"); - return PTS_UNRESOLVED; + return PTS_UNRESOLVED; } /* diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_getvalue/4-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_getvalue/4-1.c index f27b3a4318..fcd2f0662a 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_getvalue/4-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_getvalue/4-1.c @@ -1,8 +1,8 @@ /* Copyright (c) 2003, Intel Corporation. All rights reserved. Created by: majid.awad REMOVE-THIS AT intel DOT com - This file is licensed under the GPL license. For the full content - of this license, see the COPYING file at the top level of this + This file is licensed under the GPL license. For the full content + of this license, see the COPYING file at the top level of this source tree. */ @@ -28,7 +28,7 @@ int main() { - char semname[20]; + char semname[50]; sem_t *mysemp; int val; diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_getvalue/5-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_getvalue/5-1.c index 837f34c899..e03b923437 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_getvalue/5-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_getvalue/5-1.c @@ -1,13 +1,13 @@ /* Copyright (c) 2003, Intel Corporation. All rights reserved. Created by: majid.awad REMOVE-THIS AT intel DOT com - This file is licensed under the GPL license. For the full content - of this license, see the COPYING file at the top level of this + This file is licensed under the GPL license. For the full content + of this license, see the COPYING file at the top level of this source tree. */ /* - * This test case verifies that calling sem_getvalue doesn't change the + * This test case verifies that calling sem_getvalue doesn't change the * state of the semaphore. */ @@ -27,7 +27,7 @@ int main() { - char semname[20]; + char semname[50]; sem_t *mysemp; int val; @@ -43,7 +43,7 @@ int main() { if( sem_getvalue(mysemp, &val) == -1 ) { perror(ERROR_PREFIX "sem_getvalue"); - return PTS_UNRESOLVED; + return PTS_UNRESOLVED; } if ( sem_trywait(mysemp) == -1 ) { @@ -53,7 +53,7 @@ int main() { if( sem_getvalue(mysemp, &val) == -1 ) { perror(ERROR_PREFIX "sem_getvalue"); - return PTS_UNRESOLVED; + return PTS_UNRESOLVED; } /* diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_open/1-4.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_open/1-4.c index 143f64a6ab..c04ea15367 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_open/1-4.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_open/1-4.c @@ -1,14 +1,14 @@ /* Copyright (c) 2002-2003, Intel Corporation. All rights reserved. Created by: majid.awad REMOVE-THIS AT intel DOT com - This file is licensed under the GPL license. For the full content - of this license, see the COPYING file at the top level of this + This file is licensed under the GPL license. For the full content + of this license, see the COPYING file at the top level of this source tree. */ /* - sem_open test case that attempts to open a new semaphoree, and then - try to un-lock it with sem_post. Making sure the semaphore is not locked. + sem_open test case that attempts to open a new semaphoree, and then + try to un-lock it with sem_post. Making sure the semaphore is not locked. */ #include @@ -28,7 +28,7 @@ int main() { sem_t *mysemp; - char semname[20]; + char semname[50]; sprintf(semname, "/" FUNCTION "_" TEST "_%ld", (long)getpid()); diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_open/5-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_open/5-1.c index 2d64d40eb4..85a1aa4dd0 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_open/5-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_open/5-1.c @@ -1,8 +1,8 @@ /* Copyright (c) 2002-2003, Intel Corporation. All rights reserved. Created by: majid.awad REMOVE-THIS AT intel DOT com - This file is licensed under the GPL license. For the full content - of this license, see the COPYING file at the top level of this + This file is licensed under the GPL license. For the full content + of this license, see the COPYING file at the top level of this source tree. */ /* diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_open/6-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_open/6-1.c index 306b791dc0..d356cf86ed 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_open/6-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_open/6-1.c @@ -1,8 +1,8 @@ /* Copyright (c) 2002-2003, Intel Corporation. All rights reserved. Created by: majid.awad REMOVE-THIS AT intel DOT com - This file is licensed under the GPL license. For the full content - of this license, see the COPYING file at the top level of this + This file is licensed under the GPL license. For the full content + of this license, see the COPYING file at the top level of this source tree. */ /* diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/1-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/1-1.c index 0a3ddae1f9..5f25734462 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/1-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/1-1.c @@ -1,8 +1,8 @@ /* Copyright (c) 2003, Intel Corporation. All rights reserved. Created by: majid.awad REMOVE-THIS AT intel DOT com - This file is licensed under the GPL license. For the full content - of this license, see the COPYING file at the top level of this + This file is licensed under the GPL license. For the full content + of this license, see the COPYING file at the top level of this source tree. */ @@ -29,7 +29,7 @@ int main() { sem_t *mysemp; - char semname[20]; + char semname[50]; int val; sprintf(semname, "/" FUNCTION "_" TEST "_%ld", (long)getpid()); @@ -44,7 +44,7 @@ int main() { if( sem_post(mysemp) == -1 ) { perror(ERROR_PREFIX "sem_post"); - return PTS_UNRESOLVED; + return PTS_UNRESOLVED; } @@ -58,7 +58,7 @@ int main() { sem_close(mysemp); sem_unlink(semname); return PTS_PASS; - } else { + } else { puts("TEST FAILED"); return PTS_FAIL; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/1-2.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/1-2.c index 2b637d1058..a3bac0aa03 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/1-2.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/1-2.c @@ -1,8 +1,8 @@ /* Copyright (c) 2003, Intel Corporation. All rights reserved. Created by: majid.awad REMOVE-THIS AT intel DOT com - This file is licensed under the GPL license. For the full content - of this license, see the COPYING file at the top level of this + This file is licensed under the GPL license. For the full content + of this license, see the COPYING file at the top level of this source tree. */ @@ -29,7 +29,7 @@ int main() { sem_t *mysemp; - char semname[20]; + char semname[50]; int val; sprintf(semname, "/" FUNCTION "_" TEST "_%ld", (long)getpid()); @@ -44,7 +44,7 @@ int main() { if( sem_post(mysemp) == -1 ) { perror(ERROR_PREFIX "sem_post"); - return PTS_UNRESOLVED; + return PTS_UNRESOLVED; } @@ -58,7 +58,7 @@ int main() { sem_close(mysemp); sem_unlink(semname); return PTS_PASS; - } else { + } else { puts("TEST FAILED"); return PTS_FAIL; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/2-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/2-1.c index 3a0883e704..edf6a8c761 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/2-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/2-1.c @@ -1,8 +1,8 @@ /* Copyright (c) 2003, Intel Corporation. All rights reserved. Created by: majid.awad REMOVE-THIS AT intel DOT com - This file is licensed under the GPL license. For the full content - of this license, see the COPYING file at the top level of this + This file is licensed under the GPL license. For the full content + of this license, see the COPYING file at the top level of this source tree. */ @@ -29,7 +29,7 @@ int main() { sem_t *mysemp; - char semname[20]; + char semname[50]; sprintf(semname, "/" FUNCTION "_" TEST "_%ld", (long)getpid()); @@ -42,7 +42,7 @@ int main() { if( sem_wait(mysemp) == -1 ) { perror(ERROR_PREFIX "sem_post"); - return PTS_UNRESOLVED; + return PTS_UNRESOLVED; } if(( sem_post(mysemp)) == 0 ) { @@ -50,7 +50,7 @@ int main() { sem_close(mysemp); sem_unlink(semname); return PTS_PASS; - } else { + } else { puts("TEST FAILED: value of sem_post is not zero"); return PTS_FAIL; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/4-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/4-1.c index ebfc3be596..c96d5044c5 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/4-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/4-1.c @@ -1,8 +1,8 @@ /* Copyright (c) 2003, Intel Corporation. All rights reserved. Created by: majid.awad REMOVE-THIS AT intel DOT com - This file is licensed under the GPL license. For the full content - of this license, see the COPYING file at the top level of this + This file is licensed under the GPL license. For the full content + of this license, see the COPYING file at the top level of this source tree. */ @@ -28,7 +28,7 @@ int main() { sem_t *mysemp; - char semname[20]; + char semname[50]; sprintf(semname, "/" FUNCTION "_" TEST "_%ld", (long)getpid()); @@ -44,7 +44,7 @@ int main() { sem_close(mysemp); sem_unlink(semname); return PTS_PASS; - } else { + } else { puts("TEST FAILED: value of sem_post is not returning zero"); return PTS_FAIL; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/5-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/5-1.c index 6f7871b5e2..8368f43e8b 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/5-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/5-1.c @@ -43,7 +43,7 @@ void sighdl(int sig) } int main() { - char semname[20]; + char semname[50]; int val; sprintf(semname, "/" FUNCTION "_" TEST "_%ld", (long)getpid()); @@ -59,7 +59,7 @@ int main() { if( sem_post(gsemp) == -1 ) { perror(ERROR_PREFIX "sem_post"); - exit(PTS_UNRESOLVED); + exit(PTS_UNRESOLVED); } /* Checking if the value of the Semaphore incremented by one */ diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/6-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/6-1.c index 5aed51eb95..88def9f573 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/6-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_post/6-1.c @@ -40,12 +40,12 @@ void handler(int signo) { if( sem_post(gsemp) == -1 ) { perror(ERROR_PREFIX "sem_post"); - exit(PTS_UNRESOLVED); + exit(PTS_UNRESOLVED); } } int main() { - char semname[20]; + char semname[50]; struct sigaction act; int val; diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_unlink/1-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_unlink/1-1.c index 9924a4c7f5..ec612442a6 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_unlink/1-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_unlink/1-1.c @@ -1,8 +1,8 @@ /* Copyright (c) 2003, Intel Corporation. All rights reserved. Created by: majid.awad REMOVE-THIS AT intel DOT com - This file is licensed under the GPL license. For the full content - of this license, see the COPYING file at the top level of this + This file is licensed under the GPL license. For the full content + of this license, see the COPYING file at the top level of this source tree. */ @@ -29,7 +29,7 @@ int main() { sem_t *mysemp; - char semname[20]; + char semname[50]; sprintf(semname, "/" FUNCTION "_" TEST "_%ld", (long)getpid()); diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_unlink/2-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_unlink/2-1.c index d83ea7608b..d70a31f067 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_unlink/2-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_unlink/2-1.c @@ -1,8 +1,8 @@ /* Copyright (c) 2003, Intel Corporation. All rights reserved. Created by: majid.awad REMOVE-THIS AT intel DOT com - This file is licensed under the GPL license. For the full content - of this license, see the COPYING file at the top level of this + This file is licensed under the GPL license. For the full content + of this license, see the COPYING file at the top level of this source tree. */ @@ -29,7 +29,7 @@ int main() { sem_t *mysemp; - char semname[20]; + char semname[50]; sprintf(semname, "/" FUNCTION "_" TEST "_%ld", (long)getpid()); diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/1-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/1-1.c index 8d041d732c..4f1b058f62 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/1-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/1-1.c @@ -1,8 +1,8 @@ /* * Copyright (c) 2003, Intel Corporation. All rights reserved. * Created by: majid.awad REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this * source tree. */ @@ -29,7 +29,7 @@ int main() { sem_t *mysemp; - char semname[20]; + char semname[50]; int val; sprintf(semname, "/" FUNCTION "_" TEST "_%ld", (long)getpid()); @@ -45,7 +45,7 @@ int main() { /* Lock Semaphore */ if( sem_wait(mysemp) == -1 ) { perror(ERROR_PREFIX "sem_wait"); - return PTS_UNRESOLVED; + return PTS_UNRESOLVED; } @@ -60,7 +60,7 @@ int main() { sem_close(mysemp); sem_unlink(semname); return PTS_PASS; - } else { + } else { puts("TEST FAILED"); return PTS_FAIL; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/1-2.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/1-2.c index f409dc9ec2..32fb435c3c 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/1-2.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/1-2.c @@ -1,13 +1,13 @@ /* * Copyright (c) 2003, Intel Corporation. All rights reserved. * Created by: majid.awad REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this * source tree. */ /* - * Keep calling sem_wait until the sempahore is locked. That is + * Keep calling sem_wait until the sempahore is locked. That is * decrementing the semaphore value by one until its zero or locked. */ @@ -30,7 +30,7 @@ int main() { sem_t *mysemp; - char semname[20]; + char semname[50]; int value = 10; int val; @@ -49,7 +49,7 @@ int main() { perror(ERROR_PREFIX "sem_getvalue"); return PTS_UNRESOLVED; } else { - value--; + value--; } } @@ -63,7 +63,7 @@ int main() { sem_unlink(semname); sem_close(mysemp); return PTS_PASS; - } else { + } else { puts("TEST FAILED: Semaphore is not locked"); return PTS_FAIL; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/11-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/11-1.c index 8a3f47621a..3488a34488 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/11-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/11-1.c @@ -1,13 +1,13 @@ /* * Copyright (c) 2003, Intel Corporation. All rights reserved. * Created by: majid.awad REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this * source tree. */ /* - * sem_trywait shall try to lock the unlocked semaphore and decrement + * sem_trywait shall try to lock the unlocked semaphore and decrement * the semaphore value by one. */ @@ -29,7 +29,7 @@ int main() { sem_t *mysemp; - char semname[20]; + char semname[50]; int val; sprintf(semname, "/" FUNCTION "_" TEST "_%ld", (long)getpid()); @@ -45,7 +45,7 @@ int main() { /* Lock Semaphore by sem_trywait*/ if( sem_trywait(mysemp) == -1 ) { perror(ERROR_PREFIX "sem_wait"); - return PTS_UNRESOLVED; + return PTS_UNRESOLVED; } @@ -60,7 +60,7 @@ int main() { sem_unlink(semname); sem_close(mysemp); return PTS_PASS; - } else { + } else { puts("TEST FAILED"); return PTS_FAIL; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/12-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/12-1.c index f97f9ac4bf..7d3ee805bb 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/12-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/12-1.c @@ -1,13 +1,13 @@ /* * Copyright (c) 2003, Intel Corporation. All rights reserved. * Created by: majid.awad REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this * source tree. */ /* - * sem_trywait shall try to lock the locked semaphore and decrement + * sem_trywait shall try to lock the locked semaphore and decrement * the semaphore value by one. */ @@ -29,7 +29,7 @@ int main() { sem_t *mysemp; - char semname[20]; + char semname[50]; sprintf(semname, "/" FUNCTION "_" TEST "_%ld", (long)getpid()); diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/3-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/3-1.c index ddc606adb8..b14cad4a4b 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/3-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/3-1.c @@ -1,12 +1,12 @@ /* * Copyright (c) 2003, Intel Corporation. All rights reserved. * Created by: majid.awad REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this * source tree. */ -/* This test case verifies that the semaphore shall be locked until the +/* This test case verifies that the semaphore shall be locked until the * sem_post is executed and returns successfully. * Lines: 39056-39057 */ @@ -28,9 +28,9 @@ int main() -{ +{ sem_t *mysemp; - char semname[20]; + char semname[50]; int val; sprintf(semname, "/" FUNCTION "_" TEST "_%ld", (long)getpid()); diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/5-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/5-1.c index b2808b3015..111beac181 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/5-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/5-1.c @@ -1,13 +1,13 @@ /* * Copyright (c) 2003, Intel Corporation. All rights reserved. * Created by: majid.awad REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this * source tree. */ /* - * errno return EAGAIN: The semaphore can't be immediately locked by + * errno return EAGAIN: The semaphore can't be immediately locked by * sem_trywait when its already locked. */ @@ -29,7 +29,7 @@ int main() { sem_t *mysemp; - char semname[20]; + char semname[50]; sprintf(semname, "/" FUNCTION "_" TEST "_%ld", (long)getpid()); diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/7-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/7-1.c index 714773a6ce..7d47b6c307 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/7-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sem_wait/7-1.c @@ -36,7 +36,7 @@ void handler(int signo) int main() { sem_t *mysemp; - char semname[20]; + char semname[50]; int pid, status; sprintf(semname, "/" FUNCTION "_" TEST "_%ld", (long)getpid());