[rtems commit] sigsuspend.c: Address set but unused variable warning

Joel Sherrill joel at rtems.org
Sat Sep 21 21:19:52 UTC 2013


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

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Sat Sep 21 16:16:25 2013 -0500

sigsuspend.c: Address set but unused variable warning

---

 cpukit/posix/src/sigsuspend.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/cpukit/posix/src/sigsuspend.c b/cpukit/posix/src/sigsuspend.c
index c3ab2bb..ab935d1 100644
--- a/cpukit/posix/src/sigsuspend.c
+++ b/cpukit/posix/src/sigsuspend.c
@@ -33,17 +33,20 @@ int sigsuspend(
 {
   sigset_t            saved_signals_blocked;
   sigset_t            current_unblocked_signals;
-  int                 status;
 
   /*
    *  We use SIG_BLOCK and not SIG_SETMASK because there may be
    *  signals which might be pending, which might get caught here.
    *  We want the signals to be caught inside sigtimedwait.
+   *
+   *  We ignore the return status codes because sigsuspend() is
+   *  defined to either terminate or return -1 with errno set to 
+   *  EINTR.
    */
-  status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked );
+  (void) sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked );
 
   current_unblocked_signals = ~(*sigmask);
-  status = sigtimedwait( &current_unblocked_signals, NULL, NULL );
+  (void) sigtimedwait( &current_unblocked_signals, NULL, NULL );
 
   (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL );
 




More information about the vc mailing list