bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new module 'sigprocmask'


From: Eric Blake
Subject: Re: new module 'sigprocmask'
Date: Tue, 17 Oct 2006 15:27:20 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Bruno Haible <bruno <at> clisp.org> writes:

> 
> This module adds a sigprocmask() emulation based on signal().
> 
> Comments are welcome, as this is new and so far untested code.
> 
> + 
> +       for (sig = 0; sig < NSIG; sig++)
> +         if (received[NSIG])
> +           {
> +             #if HAVE_RAISE
> +             raise (sig);
> +             #else
> +             kill (getpid (), sig);
> +             #endif
> +           }
> +     }

Oops, on mingw, that typo made the process randomly abort during 
unblock_fatal_signals() because it was dereferencing beyond the array and 
raising an unknown signal number.  Checking in this obvious patch:

2006-10-17  Eric Blake  <address@hidden>

        * lib/sigprocmask.c (sigprocmask): Fix typo.

Index: lib/sigprocmask.c
===================================================================
RCS file: /sources/gnulib/gnulib/lib/sigprocmask.c,v
retrieving revision 1.1
diff -u -r1.1 sigprocmask.c
--- lib/sigprocmask.c   16 Oct 2006 11:55:35 -0000      1.1
+++ lib/sigprocmask.c   17 Oct 2006 15:24:31 -0000
@@ -178,7 +178,7 @@
              received[sig] = 0;
 
          for (sig = 0; sig < NSIG; sig++)
-           if (received[NSIG])
+           if (received[sig])
              {
                #if HAVE_RAISE
                raise (sig);







reply via email to

[Prev in Thread] Current Thread [Next in Thread]