This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  9476515fd31e416739d850c1948e9222a53deea9 (commit)
      from  59fafc02de4ca165428fffdef8fd5d2a63824b67 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=9476515fd31e416739d850c1948e9222a53deea9


commit 9476515fd31e416739d850c1948e9222a53deea9
Author: Mats Erik Andersson <[email protected]>
Date:   Thu Dec 22 00:53:58 2011 +0100

    libinetutils/setsig.c: Incomplete replacement code.
    
    No error checking; unjustified assumption on recovery
    of old signal mask; dropping of signal flags when
    activating SA_RESTART.  All are portability issues.

diff --git a/ChangeLog b/ChangeLog
index 6a15c71..12aefbe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-12-22  Mats Erik Andersson <[email protected]>
+
+       * libinetutils/setsig.c (setsig) [HAVE_SIGACTION]: New variable OSA.
+       Superpose SA_RESTART on SA_FLAGS, no replacement!  Use OSA for old
+       signal mask in calling sigaction.  Return SIG_ERR on error, or fetch
+       old signal handler from OSA upon success.
+       [HAVE_SIGVEC]: Likewise:  New variable OSV.  Use OSV in call to sigvec.
+       Return SIG_ERR on error, or old handler brought in from OSV.
+
 2011-12-20  Mats Erik Andersson <[email protected]>
 
        * src/rlogind.c (rlogind_auth) [IP_OPTIONS]: Abort connection as soon
diff --git a/libinetutils/setsig.c b/libinetutils/setsig.c
index 3fa3c08..3a60906 100644
--- a/libinetutils/setsig.c
+++ b/libinetutils/setsig.c
@@ -31,21 +31,23 @@ sighandler_t
 setsig (int sig, sighandler_t handler)
 {
 #ifdef HAVE_SIGACTION
-  struct sigaction sa;
+  struct sigaction sa, osa;
   sigemptyset (&sa.sa_mask);
 # ifdef SA_RESTART
-  sa.sa_flags = SA_RESTART;
+  sa.sa_flags |= SA_RESTART;
 # endif
   sa.sa_handler = handler;
-  sigaction (sig, &sa, &sa);
-  return sa.sa_handler;
+  if (sigaction (sig, &sa, &osa) < 0)
+    return SIG_ERR;
+  return osa.sa_handler;
 #else /* !HAVE_SIGACTION */
 # ifdef HAVE_SIGVEC
-  struct sigvec sv;
+  struct sigvec sv, osv;
   sigemptyset (&sv.sv_mask);
   sv.sv_handler = handler;
-  sigvec (sig, &sv, &sv);
-  return sv.sv_handler;
+  if (sigvec (sig, &sv, &osv) < 0)
+    return SIG_ERR;
+  return osv.sv_handler;
 # else /* !HAVE_SIGVEC */
   return signal (sig, handler);
 # endif        /* HAVE_SIGVEC */

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog             |    9 +++++++++
 libinetutils/setsig.c |   16 +++++++++-------
 2 files changed, 18 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 

_______________________________________________
Commit-inetutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/commit-inetutils

Reply via email to