Attached patch correct the pthread_kill() return value to match the POSIX standard.

Jay

Index: ecos/packages/compat/posix/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/compat/posix/current/ChangeLog,v
retrieving revision 1.56
diff -u -5 -p -r1.56 ChangeLog
--- ecos/packages/compat/posix/current/ChangeLog        25 Mar 2009 08:03:56 
-0000      1.56
+++ ecos/packages/compat/posix/current/ChangeLog        8 Feb 2010 22:16:58 
-0000
@@ -1,5 +1,10 @@
+2010-02-08  Jay Foster  <[email protected]>
+
+       * src/signal.cxx (pthread_kill): Corrected return value for
+       pthread_kill() to match POSIX standard.
+
 2009-03-25  John Dallaway  <[email protected]>
 
        * src/signal.cxx (pause): Revert change of 2006-07-18 pending
        updating of the signal1, signal3 and timer1 tests.
        [ Bugzilla 1000689, 1000690 ]
Index: ecos/packages/compat/posix/current/src/signal.cxx
===================================================================
RCS file: /cvs/ecos/ecos/packages/compat/posix/current/src/signal.cxx,v
retrieving revision 1.21
diff -u -5 -p -r1.21 signal.cxx
--- ecos/packages/compat/posix/current/src/signal.cxx   25 Mar 2009 08:03:56 
-0000      1.21
+++ ecos/packages/compat/posix/current/src/signal.cxx   8 Feb 2010 22:16:59 
-0000
@@ -552,28 +552,28 @@ externC int kill (pid_t pid, int sig)
 externC int pthread_kill (pthread_t threadid, int sig)
 {
     SIGNAL_ENTRY();
 
     if( !SIGNAL_VALID(sig) )
-        SIGNAL_RETURN(EINVAL);
+        SIGNAL_RETURN_VALUE(EINVAL);
     
     struct sigevent sev;
 
     pthread_info *thread = pthread_info_id(threadid);
 
     if( thread == NULL )
-        SIGNAL_RETURN(ESRCH);
+        SIGNAL_RETURN_VALUE(ESRCH);
     
     sev.sigev_notify           = SIGEV_SIGNAL;
     sev.sigev_signo            = sig;
     sev.sigev_value.sival_int  = 0;
     
     cyg_sigqueue( &sev, SI_USER, thread );
 
     cyg_deliver_signals();
     
-    SIGNAL_RETURN(0);
+    SIGNAL_RETURN_VALUE(0);
 }
 
 //==========================================================================
 // Functions to catch signals
 
Index: ecos/packages/io/fileio/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/fileio/current/ChangeLog,v
retrieving revision 1.70
diff -u -5 -p -r1.70 ChangeLog
--- ecos/packages/io/fileio/current/ChangeLog   2 Mar 2009 20:54:10 -0000       
1.70
+++ ecos/packages/io/fileio/current/ChangeLog   8 Feb 2010 22:17:00 -0000
@@ -1,5 +1,10 @@
+2010-02-08  Jay Foster <[email protected]>
+
+       * tests/pselect.c: Corrected return value of pthread_kill()
+       to match POSIX standard.
+
 2008-11-18  Rutger Hofman <[email protected]>
 
        * src/file.cxx: add a chmod() call, implemented by calling
        cyg_fs_setinfo with parameter FS_INFO_CHMOD
 
Index: ecos/packages/io/fileio/current/tests/pselect.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/fileio/current/tests/pselect.c,v
retrieving revision 1.5
diff -u -5 -p -r1.5 pselect.c
--- ecos/packages/io/fileio/current/tests/pselect.c     29 Jan 2009 17:49:46 
-0000      1.5
+++ ecos/packages/io/fileio/current/tests/pselect.c     8 Feb 2010 22:17:00 
-0000
@@ -271,11 +271,12 @@ void *pthread_entry2( void *arg)
     while( sigusr1_sent < NUM_TEST_SIGNALS )
     {
         nanosleep( &zzz, NULL );
 
         err = pthread_kill( thread1, SIGUSR1 );
-        if( err < 0 ) SHOW_RESULT( pthread_kill, err );
+        if( err != 0 )
+                       diag_printf("INFO: pthread_kill() returned %d %s\n", 
err, strerror(err));
 
         sigusr1_sent++;
 
         if( (sigusr1_sent % 500) == 0 )
             diag_printf("INFO: <Thread 2: %d signals sent>\n",sigusr1_sent);

Reply via email to