Mercurial > hg > octave-shane > gnulib-hg
annotate modules/frexpl @ 17388:3c592b4deb04
utimensat-tests, etc.: try to fix some races
Problem reported by Bernhard Voelker in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-04/msg00071.html>.
I don't know whether this patch fixes that race condition, but it
fixes *some* race conditions, so it should be a win.
* modules/chown-tests (Depends-on):
* modules/fchownat-tests (Depends-on):
* modules/fdutimensat-tests (Depends-on):
* modules/futimens-tests (Depends-on):
* modules/lchown-tests (Depends-on):
* modules/stat-time-tests (Depends-on):
* modules/utimens-tests (Depends-on):
* modules/utimensat-tests (Depends-on):
Depend on nanosleep, not usleep.
* modules/chown-tests (test_chown_LDADD):
* modules/lchown-tests (test_lchown_LDADD):
* modules/stat-time-tests (test_stat_time_LDADD):
New macro.
* modules/fchownat-tests (test_fchownat_LDADD):
* modules/fdutimensat-tests (test_fdutimensat_LDADD):
* modules/futimens-tests (test_futimens_LDADD):
* modules/utimens-tests (test_utimens_LDADD):
* modules/utimensat-tests (test_utimensat_LDADD):
Add $(LIB_NANOSLEEP).
* modules/stat-time-tests (Files): Add tests/nap.h.
* tests/nap.h: Include <limits.h>, for INT_MAX.
(lt_mtime): Remove.
(diff_timespec): New function.
(get_stat): Rename from get_mtime. All callers changed.
(nap_works): Determine the needed delay by inspecting the
file system's timestamp jumps; this should be more reliable.
Look at both mtime and ctime, and take the maximum of the two jumps.
(nap_works, guess_delay):
Return a nanosecond cound, not a microsecond count.
All callers changed.
(nap_works, nap): Use nanosleep, not usleep. Check for nanosleep
failure.
(nap): Multiply the guess by 1.125, to accommodate the case where
the file system's clock is a bit slower than nanosleep's clock.
* tests/test-stat-time.c (BASE): New macro.
Include nap.h.
(nap): Remove; nap.h now defines this. This removes a duplicate
implementation of 'nap'.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 30 Apr 2013 23:14:19 -0700 |
parents | fdbe3125f81a |
children |
rev | line source |
---|---|
8497 | 1 Description: |
2 frexpl() function: split a 'long double' into its constituents. | |
3 | |
4 Files: | |
5 lib/frexpl.c | |
6 lib/frexp.c | |
7 m4/frexpl.m4 | |
8 | |
9 Depends-on: | |
10 math | |
16580
fdbe3125f81a
math: Ensure declarations of math functions.
Bruno Haible <bruno@clisp.org>
parents:
15932
diff
changeset
|
11 extensions |
15932
0057ae480fc5
frexpl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14998
diff
changeset
|
12 frexp [{ test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1] |
0057ae480fc5
frexpl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14998
diff
changeset
|
13 isnanl-nolibm [{ test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0] |
0057ae480fc5
frexpl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14998
diff
changeset
|
14 fpucw [{ test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0] |
8497 | 15 |
16 configure.ac: | |
17 gl_FUNC_FREXPL | |
14998
6670ce6a8984
frexpl*: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents:
14683
diff
changeset
|
18 if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then |
6670ce6a8984
frexpl*: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents:
14683
diff
changeset
|
19 AC_LIBOBJ([frexpl]) |
6670ce6a8984
frexpl*: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents:
14683
diff
changeset
|
20 fi |
8497 | 21 gl_MATH_MODULE_INDICATOR([frexpl]) |
22 | |
23 Makefile.am: | |
24 | |
25 Include: | |
26 <math.h> | |
27 | |
8627
fd0df3b4a14d
Clarify the dependencies on libm.
Bruno Haible <bruno@clisp.org>
parents:
8531
diff
changeset
|
28 Link: |
fd0df3b4a14d
Clarify the dependencies on libm.
Bruno Haible <bruno@clisp.org>
parents:
8531
diff
changeset
|
29 $(FREXPL_LIBM) |
fd0df3b4a14d
Clarify the dependencies on libm.
Bruno Haible <bruno@clisp.org>
parents:
8531
diff
changeset
|
30 |
8497 | 31 License: |
32 LGPL | |
33 | |
34 Maintainer: | |
35 Bruno Haible, Paolo Bonzini | |
36 |