diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2022-09-28 00:29:09 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2022-09-28 00:37:12 -0700 |
commit | a9b29ee4a0ffa4878d67eaf518dbeed098844b9e (patch) | |
tree | bbde8d6eae8b3676bb1d9f74d8ce0f6d7016c834 /m4/nanosleep.m4 | |
parent | c1eb13b32676b288a3ab3826501caf7bcd376b7f (diff) | |
download | emacs-a9b29ee4a0ffa4878d67eaf518dbeed098844b9e.tar.gz emacs-a9b29ee4a0ffa4878d67eaf518dbeed098844b9e.tar.bz2 emacs-a9b29ee4a0ffa4878d67eaf518dbeed098844b9e.zip |
Update from Gnulib by running admin/merge-gnulib
Diffstat (limited to 'm4/nanosleep.m4')
-rw-r--r-- | m4/nanosleep.m4 | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/m4/nanosleep.m4 b/m4/nanosleep.m4 index 1964b1ea47d..dfe21f56d5c 100644 --- a/m4/nanosleep.m4 +++ b/m4/nanosleep.m4 @@ -1,4 +1,4 @@ -# serial 41 +# serial 42 dnl From Jim Meyering. dnl Check for the nanosleep function. @@ -100,15 +100,22 @@ AC_DEFUN([gl_FUNC_NANOSLEEP], #else /* A simpler test for native Windows. */ if (nanosleep (&ts_sleep, &ts_remaining) < 0) return 3; + /* Test for 32-bit mingw bug: negative nanosecond values do not + cause failure. */ + ts_sleep.tv_sec = 1; + ts_sleep.tv_nsec = -1; + if (nanosleep (&ts_sleep, &ts_remaining) != -1) + return 7; #endif return 0; }]])], [gl_cv_func_nanosleep=yes], - [case $? in dnl ( - 4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)';; dnl ( - *) gl_cv_func_nanosleep=no;; + [case $? in + 4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)' ;; + 7) gl_cv_func_nanosleep='no (mishandles negative tv_nsec)' ;; + *) gl_cv_func_nanosleep=no ;; esac], - [case "$host_os" in dnl (( + [case "$host_os" in linux*) # Guess it halfway works when the kernel is Linux. gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;; mingw*) # Guess no on native Windows. |