[rtems commit] psxtests/psxhdrs: Fix cleanup push/pop test

Sebastian Huber sebh at rtems.org
Fri Jul 5 13:56:38 UTC 2013


Module:    rtems
Branch:    master
Commit:    5e2a66d5c9abd46fcfebe993ef130e87e05890e3
Changeset: http://git.rtems.org/rtems/commit/?id=5e2a66d5c9abd46fcfebe993ef130e87e05890e3

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Jul  5 14:53:57 2013 +0200

psxtests/psxhdrs: Fix cleanup push/pop test

The pthread_cleanup_push() and pthread_cleanup_pop() statements must
appear as a pair in the same lexical scope as required by POSIX.

---

 testsuites/psxtests/psxhdrs/Makefile.am |    2 +-
 testsuites/psxtests/psxhdrs/pthread32.c |    2 ++
 testsuites/psxtests/psxhdrs/pthread33.c |   28 ----------------------------
 3 files changed, 3 insertions(+), 29 deletions(-)

diff --git a/testsuites/psxtests/psxhdrs/Makefile.am b/testsuites/psxtests/psxhdrs/Makefile.am
index 7b216cb..086df57 100644
--- a/testsuites/psxtests/psxhdrs/Makefile.am
+++ b/testsuites/psxtests/psxhdrs/Makefile.am
@@ -9,7 +9,7 @@ lib_a_SOURCES = clock01.c clock02.c clock03.c clock04.c clock05.c clock06.c \
     pthread13.c pthread14.c pthread15.c pthread16.c pthread17.c pthread18.c \
     pthread19.c pthread20.c pthread21.c pthread22.c pthread23.c pthread24.c \
     pthread25.c pthread26.c pthread27.c pthread28.c pthread29.c pthread30.c \
-    pthread31.c pthread32.c pthread33.c pthread34.c pthread35.c pthread36.c \
+    pthread31.c pthread32.c pthread34.c pthread35.c pthread36.c \
     pthread37.c pthread38.c pthread39.c pthread40.c \
     proc01.c proc02.c proc03.c proc04.c proc05.c proc06.c proc07.c proc08.c \
     proc09.c proc10.c proc11.c proc12.c proc13.c proc14.c sched01.c \
diff --git a/testsuites/psxtests/psxhdrs/pthread32.c b/testsuites/psxtests/psxhdrs/pthread32.c
index 99cf78b..ccc4f68 100644
--- a/testsuites/psxtests/psxhdrs/pthread32.c
+++ b/testsuites/psxtests/psxhdrs/pthread32.c
@@ -27,6 +27,7 @@ void cleanup_routine(
   void *argument
 )
 {
+  (void) argument;
 }
 
 void test( void )
@@ -36,4 +37,5 @@ void test( void )
   argument = 0;
 
   pthread_cleanup_push( cleanup_routine, &argument );
+  pthread_cleanup_pop( 1 );
 }
diff --git a/testsuites/psxtests/psxhdrs/pthread33.c b/testsuites/psxtests/psxhdrs/pthread33.c
deleted file mode 100644
index 5206aec..0000000
--- a/testsuites/psxtests/psxhdrs/pthread33.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *  This test file is used to verify that the header files associated with
- *  invoking this function are correct.
- *
- *  COPYRIGHT (c) 1989-2009.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.com/license/LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <pthread.h>
-
-#ifndef _POSIX_THREADS
-#error "rtems is supposed to have pthread_cleanup_pop"
-#endif
-
-void test( void );
-
-void test( void )
-{
-  pthread_cleanup_pop( 1 );
-}




More information about the vc mailing list