annotate modules/xprintf @ 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 b9a762d04d6c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9364
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
1 Description:
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
2 a wrapper around printf that calls error upon ENOMEM or EILSEQ errors
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
3
9415
8ea12c7d7d59 Notify xgettext about functions that have a format string argument.
Bruno Haible <bruno@clisp.org>
parents: 9373
diff changeset
4 Notice:
8ea12c7d7d59 Notify xgettext about functions that have a format string argument.
Bruno Haible <bruno@clisp.org>
parents: 9373
diff changeset
5 If you are using GNU gettext version 0.16.1 or older, add the following options
8ea12c7d7d59 Notify xgettext about functions that have a format string argument.
Bruno Haible <bruno@clisp.org>
parents: 9373
diff changeset
6 to XGETTEXT_OPTIONS in your po/Makevars:
8ea12c7d7d59 Notify xgettext about functions that have a format string argument.
Bruno Haible <bruno@clisp.org>
parents: 9373
diff changeset
7 --flag=xprintf:1:c-format --flag=xvprintf:1:c-format
8ea12c7d7d59 Notify xgettext about functions that have a format string argument.
Bruno Haible <bruno@clisp.org>
parents: 9373
diff changeset
8 --flag=xfprintf:2:c-format --flag=xvfprintf:2:c-format
8ea12c7d7d59 Notify xgettext about functions that have a format string argument.
Bruno Haible <bruno@clisp.org>
parents: 9373
diff changeset
9
9364
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
10 Files:
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
11 lib/xprintf.h
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
12 lib/xprintf.c
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
13
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
14 Depends-on:
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
15 error
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
16 exitfail
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
17 gettext-h
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
18 stdarg
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
19 stdio
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
20
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
21 configure.ac:
9415
8ea12c7d7d59 Notify xgettext about functions that have a format string argument.
Bruno Haible <bruno@clisp.org>
parents: 9373
diff changeset
22 m4_ifdef([AM_XGETTEXT_OPTION],
11796
b9a762d04d6c Avoid warnings from 'aclocal' when AM_XGETTEXT_OPTION is not defined.
Bruno Haible <bruno@clisp.org>
parents: 9415
diff changeset
23 [AM_][XGETTEXT_OPTION([--flag=xprintf:1:c-format])
b9a762d04d6c Avoid warnings from 'aclocal' when AM_XGETTEXT_OPTION is not defined.
Bruno Haible <bruno@clisp.org>
parents: 9415
diff changeset
24 AM_][XGETTEXT_OPTION([--flag=xvprintf:1:c-format])
b9a762d04d6c Avoid warnings from 'aclocal' when AM_XGETTEXT_OPTION is not defined.
Bruno Haible <bruno@clisp.org>
parents: 9415
diff changeset
25 AM_][XGETTEXT_OPTION([--flag=xfprintf:2:c-format])
b9a762d04d6c Avoid warnings from 'aclocal' when AM_XGETTEXT_OPTION is not defined.
Bruno Haible <bruno@clisp.org>
parents: 9415
diff changeset
26 AM_][XGETTEXT_OPTION([--flag=xvfprintf:2:c-format])])
9364
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
27
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
28 Makefile.am:
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
29 lib_SOURCES += xprintf.h xprintf.c
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
30
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
31 Include:
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
32 "xprintf.h"
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
33
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
34 License:
9373
c8527f8ce71e Change xprintf's license to GPL.
Jim Meyering <meyering@redhat.com>
parents: 9364
diff changeset
35 GPL
9364
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
36
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
37 Maintainer:
559ef0e161fe New module: xprintf
Jim Meyering <meyering@redhat.com>
parents:
diff changeset
38 Jim Meyering