bug-gnulib
[Top][All Lists]
Advanced

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

Re: build reports of coreutils snapshot on AIX 4.3.2


From: Paul Eggert
Subject: Re: build reports of coreutils snapshot on AIX 4.3.2
Date: Sat, 24 Feb 2007 02:06:58 -0800
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Bruno Haible <address@hidden> writes:

> So it's an endless loop in lines 71-72 of nanosleep.c.

That's weird.  I guess we should mark nanosleep as not working on your
platform.  I installed the following patch, which should be harmless
on valid nanosleep hosts; does it detect the bug on your platform?

2007-02-24  Paul Eggert  <address@hidden>

        * m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Check for a nanosleep that
        loops on small arguments.  This attempts to avoid the problem
        Bruno Haible reported for AIX 4.3.2 in
        <http://lists.gnu.org/archive/html/bug-gnulib/2007-02/msg00309.html>.

--- m4/nanosleep.m4     12 Feb 2007 18:49:19 -0000      1.28
+++ m4/nanosleep.m4     24 Feb 2007 10:01:45 -0000
@@ -60,14 +60,20 @@ AC_DEFUN([gl_FUNC_NANOSLEEP],
          static struct timespec ts_sleep;
          static struct timespec ts_remaining;
          static struct sigaction act;
+         if (! nanosleep)
+           return 1;
          act.sa_handler = check_for_SIGALRM;
-          sigemptyset (&act.sa_mask);
+         sigemptyset (&act.sa_mask);
          sigaction (SIGALRM, &act, NULL);
+         ts_sleep.tv_sec = 0;
+         ts_sleep.tv_nsec = 1;
+         alarm (1);
+         if (nanosleep (&ts_sleep, NULL) != 0)
+           return 1;
          ts_sleep.tv_sec = TYPE_MAXIMUM (time_t);
          ts_sleep.tv_nsec = 999999999;
          alarm (1);
          if (nanosleep (&ts_sleep, &ts_remaining) == -1 && errno == EINTR
-             && nanosleep
              && TYPE_MAXIMUM (time_t) - 10 < ts_remaining.tv_sec)
            return 0;
          return 119;




reply via email to

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