bug-gnulib
[Top][All Lists]
Advanced

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

Re: bogus configure output for strstr


From: Eric Blake
Subject: Re: bogus configure output for strstr
Date: Mon, 30 Aug 2010 17:31:07 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100806 Fedora/3.1.2-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.2

On 08/30/2010 05:20 PM, Bruno Haible wrote:
static void quit (int sig) { exit (sig + 128); }
...
      signal (SIGALRM, quit);

I tested this on FreeBSD, and it indeed works. And given that sleep.m4 already installs a handler, it's no less portable than what we are already doing in other tests.

If you write it like this, it will be a no-op (because the shell does
not see the signal that killed the process, it sees the exit code of the
process). You need to write

   static void quit (int sig) { exit (1); }

Huh? It won't be a signal, but it WILL be a valid exit code, and it may make post-mortem analysis easier (that is, most shells set $? to signal+128 when they detect exit via a signal; we've lost the detection of exit from a signal, but having a $? that matches in the config.log output may still be handy). Exit codes do not need to be between 1 and 127 in order to be non-zero.

Affected files: strstr.m4, strcasestr.m4, memmem.m4.

Yep, I came to the same conclusion.  Pushing my patch soon.

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

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