Bruno Haible [Sat, 19 Nov 2011 18:08:02 +0000 (19:08 +0100)]
fstatat: Simplify.
* lib/fstatat.c (AT_FUNC_NAME): Define as fstatat. On platforms where
gnulib should define rpl_fstatat, there is a
"#define fstatat rpl_fstatat" in <sys/stat.h>.
Paul Eggert [Sat, 19 Nov 2011 03:49:47 +0000 (19:49 -0800)]
test-getcwd: disambiguate exit status
* tests/test-getcwd.c (test_long_name): Return 0..7.
(main): Exit with an unambiguous exit status. The old
code yielded a mysterious mixture of two failure codes.
Paul Eggert [Sat, 19 Nov 2011 02:01:44 +0000 (18:01 -0800)]
fstatat: fix configuration bug on mingw, OpenBSD 4, Solaris 8
* lib/fstatat.c (AT_FUNC_NAME): Use HAVE_FSTAT, not
HAVE_WORKING_FSTATAT_ZERO_FLAG, to decide whether to define
rpl_fstatat or fstatat. This should fix the other problem
reported by Kai Habel in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00237.html>.
A similar problem was reported for OpenBSD 4.6 by Mats Erik Andersson
<http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00239.html>
and I reproduced it on a Solaris 8 host we still have in production.
Jim Meyering [Fri, 18 Nov 2011 11:09:16 +0000 (12:09 +0100)]
hash: deprecate poorly-named hash_insert0: use hash_insert_if_absent
* lib/hash.c (hash_insert_if_absent): Rename from hash_insert0.
Add a sentence to the comment.
(hash_insert0): New function that simply calls hash_insert_if_absent.
* lib/hash.h (hash_insert_if_absent): Declare it.
(hash_insert0): Add deprecation attribute.
(_GL_ATTRIBUTE_DEPRECATED): Define.
* lib/di-set.c (di_set_insert): Use hash_insert_if_absent,
not hash_insert0.
* NEWS: Mention it, even though it's not really an incompatible change
Prompted by a question from Matthew Booth <mbooth@redhat.com>.
Jim Meyering [Thu, 17 Nov 2011 11:27:06 +0000 (12:27 +0100)]
test-getcwd: don't leave behind a confdir3/ directory upon interrupt
Invoke the test program via an init.sh-using wrapper.
* tests/test-getcwd.sh: New file.
* modules/getcwd-tests (Files): Add it.
(Makefile.am) [TESTS]: Invoke the shell script wrapper.
Gary V. Vaughan [Tue, 1 Nov 2011 10:58:37 +0000 (17:58 +0700)]
gitlog-to-changelog: support multi-author commits.
The FSF cares about keeping track of all authors of patches to its
projects, but Git doesn't provide obvious support for multi-author
changesets. Consensus seems to be forming around the use of extra
Signed-off-by inspired lines in the log message formatted as
`Co-authored-by: A U Thor <email@example.com>' for round-tripping
multi-author commits between version control systems.
* gitlog-to-changelog: Extract `Co-authored-by:' lines from the git
log message and output in standard ChangeLog multi-author format.
Reported by Peter Rosin <peda@lysator.liu.se>
Gary V. Vaughan [Tue, 15 Nov 2011 10:39:44 +0000 (17:39 +0700)]
maint.mk: fix tight-scope.mk generation in VPATH builds.
* top/maint.mk (tight-scope.mk): Make sure to prefix file
reference with $(srcdir) so that the file is found correctly even
when running `make syntax-check' in a VPATH build.
Jim Meyering [Sat, 12 Nov 2011 15:48:09 +0000 (16:48 +0100)]
test-exclude2.sh, test-exclude5.sh: fail if test-exclude fails
These shell scripts ignored failure of the binary test-exclude,
so making the latter return 77 didn't cause them to be skipped.
* tests/test-exclude5.sh: Exit with test-exclude's error status
when that program fails. Revamp to use init.sh.
* tests/test-exclude2.sh: Likewise.
Jim Meyering [Fri, 11 Nov 2011 13:37:59 +0000 (14:37 +0100)]
test-exclude: skip tests rather than failing on deficient systems
* tests/test-exclude.c (main): Skip tests that use FNM_CASEFOLD
and FNM_LEADING_DIR on systems that lack the definitions. This affects
at least Solaris 9. Reported and diagnosed by Dagobert Michelsen in
http://thread.gmane.org/gmane.comp.gnu.grep.bugs/3947/focus=3950
Bruno Haible [Thu, 10 Nov 2011 12:48:16 +0000 (13:48 +0100)]
ptsname_r: Avoid compilation error on OSF/1 5.1.
* lib/stdlib.in.h (ptsname_r): Override if REPLACE_PTSNAME_R is 1.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_PTSNAME_R.
* m4/ptsname_r.m4 (gl_FUNC_PTSNAME_R): Set REPLACE_PTSNAME_R if the
function is not declared or incompatibly declared.
* modules/stdlib (Makefile.am): Substitute REPLACE_PTSNAME_R.
* modules/ptsname_r (Depends-on, configure.ac): Update.
* doc/glibc-functions/ptsname_r.texi: Mention the OSF/1 problems.
Bruno Haible [Thu, 10 Nov 2011 11:31:22 +0000 (12:31 +0100)]
fstatat: Make cross-compilation guess succeed everywhere except on AIX.
* m4/fstatat.m4 (gl_FUNC_FSTATAT): Require AC_CANONICAL_HOST.
When cross-compiling, guess yes on all platforms except AIX.
Reported by Ludovic Courtès <ludo@gnu.org>.
Paul Eggert [Thu, 10 Nov 2011 00:11:40 +0000 (16:11 -0800)]
fstatat: work with cross-compilation
Problem reported by Ludovic Courtès in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00136.html>.
* m4/fstatat.m4 (gl_FUNC_FSTATAT): When cross-compiling, report
"cross-compiling" and assume the bug is present. Replace
FSTATAT_ZERO_FLAG_BROKEN with HAVE_WORKING_FSTATAT_ZERO_FLAG with
an inverted sense, to be more conservative about our assumptions.
* lib/fstatat.c (rpl_fstatat): Adjust to renamed macro.
Eric Blake [Mon, 7 Nov 2011 22:26:08 +0000 (15:26 -0700)]
ptsname_r: new module
For now, this replacement focuses solely on compilation
compatibility, and assumes that isatty() and ttyname_r() work
on a master side pty; if this assumption fails, or if
thread-safety is also required, then a later patch can follow
the lead of strerror_r.c in wrapping the system ptsname()
with a lock.
* modules/ptsname_r: New module.
* m4/ptsname_r.m4 (gl_FUNC_PTSNAME_R): New file.
* lib/ptsname.c (__ptsname_r): Split...
* lib/ptsname_r.c: ...into new file.
* m4/stdlib_h.m4 (gl_STDLIB_H): Check for decl.
(gl_STDLIB_H_DEFAULTS): Set witness defaults.
* modules/stdlib (Makefile.am): Substitute witnesses.
* lib/stdlib.in.h (ptsname_r): Declare it.
* doc/glibc-functions/ptsname_r.texi (ptsname_r): Document it.
* MODULES.html.sh (Misc): Likewise.
* modules/ptsname (Depends-on): Alter dependency.
* doc/posix-functions/ptsname.texi (ptsname): Mention new module.
Jim Meyering [Wed, 9 Nov 2011 21:32:54 +0000 (22:32 +0100)]
announce-gen: be more concise when there's only one URL+tarball
* build-aux/announce-gen (get_tool_versions): When you distribute
only one type of tarball, combine the first two "Here are..."
sections and make the key-checking grammar independent of
how many tarballs there are.
Eric Blake [Wed, 9 Nov 2011 18:47:22 +0000 (11:47 -0700)]
openpty: provide a stub on mingw
On mingw, the compiler complained that 'struct termios' and
'struct winsize' were declared in the function prototype, then
failed to compile due to missing TCSAFLUSH. Since we can't
emulate ptys on mingw, it's better to just make this module
be a stub that compiles but gracefully fails.
This patch assumes that the only portable way to use openpty()
is with the fourth and fifth arguments being NULL ('struct termios'
cannot be portably initialized in a standard-compliant manner
except by open(O_TTY_INIT)/tcgetattr(), and 'struct winsize' is
not standardized); for now, applications that want to alter termios
settings still have the burden of conditional compilation to avoid
the missing tcgetattr() on mingw.
* lib/pty.in.h (includes): Provide forward declarations.
* lib/openpty.c (openpty) [mingw]: Provide ENOSYS stub.
Bruno Haible [Wed, 9 Nov 2011 01:15:01 +0000 (02:15 +0100)]
faccessat: Move AC_LIBOBJ invocation to module description.
* m4/faccessat.m4 (gl_PREREQ_FACCESSAT): New macro.
(gl_FUNC_FACESSAT): Don't test for access() here. Move AC_LIBOBJ
invocation from here...
* modules/faccessat (configure.ac): ... to here. Invoke
gl_PREREQ_FACCESSAT.
Jim Meyering [Tue, 8 Nov 2011 09:44:54 +0000 (10:44 +0100)]
maint.mk: extract GPG key ID without using a temporary file
* top/maint.mk (gpg_key_ID): Extract GPG key ID from signed tag, but
without using a temporary file. Based on a suggestion from Werner Koch
in http://thread.gmane.org/gmane.comp.encryption.gpg.devel/16496
Bruno Haible [Sun, 6 Nov 2011 18:17:07 +0000 (19:17 +0100)]
copysignl: Fix result for zero argument on HP-UX 11 with HP C.
* lib/copysignl.c (compute_minus_zerol) [HP-UX]: New function.
(minus_zerol) [HP-UX]: New macro.
(unary_minus) [HP-UX]: New function.
(copysignl) [HP-UX]: Use unary_minus function.
Bruno Haible [Mon, 17 Oct 2011 21:54:37 +0000 (23:54 +0200)]
New module 'fmal'.
* lib/math.in.h (fmal): New declaration.
* lib/fmal.c: New file.
* m4/fmal.m4: New file.
* m4/math_h.m4 (gl_MATH_H): Test whethern fmal is declared.
(gl_MATH_H_DEFAULTS): Initialize GNULIB_FMAL, HAVE_FMAL, REPLACE_FMAL.
* modules/math (Makefile.am): Substitute GNULIB_FMAL, HAVE_FMAL,
REPLACE_FMAL.
* modules/fmal: New file.
* doc/posix-functions/fmal.texi: Mention the new module and the various
bugs.
Bruno Haible [Mon, 17 Oct 2011 21:51:21 +0000 (23:51 +0200)]
New module 'fmaf'.
* lib/math.in.h (fmaf): New declaration.
* lib/fmaf.c: New file.
* m4/fmaf.m4: New file.
* m4/math_h.m4 (gl_MATH_H): Test whethern fmaf is declared.
(gl_MATH_H_DEFAULTS): Initialize GNULIB_FMAF, HAVE_FMAF, REPLACE_FMAF.
* modules/math (Makefile.am): Substitute GNULIB_FMAF, HAVE_FMAF,
REPLACE_FMAF.
* modules/fmaf: New file.
* doc/posix-functions/fmaf.texi: Mention the new module and the various
bugs.
Bruno Haible [Sun, 6 Nov 2011 01:28:32 +0000 (02:28 +0100)]
Tests for module 'fma'.
* modules/fma-tests: New file.
* tests/test-fma1.c: New file.
* tests/test-fma1.h: New file.
* tests/test-fma2.c: New file.
* tests/test-fma2.h: New file.
Bruno Haible [Mon, 17 Oct 2011 21:48:01 +0000 (23:48 +0200)]
New module 'fma'.
* lib/math.in.h (fma): New declaration.
* lib/fma.c: New file.
* m4/fma.m4: New file.
* m4/fegetround.m4: New file.
* m4/math_h.m4 (gl_MATH_H): Test whethern fma is declared.
(gl_MATH_H_DEFAULTS): Initialize GNULIB_FMA, HAVE_FMA, REPLACE_FMA.
* modules/math (Makefile.am): Substitute GNULIB_FMA, HAVE_FMA,
REPLACE_FMA.
* modules/fma: New file.
* doc/posix-functions/fma.texi: Mention the new module and the various
bugs.
Bruno Haible [Sun, 6 Nov 2011 01:14:43 +0000 (02:14 +0100)]
Extend gl_MATHFUNC.
* m4/mathfunc.m4 (gl_MATHFUNC): Accept an 4th parameter of INCLUDES.
Support 'void' as argument type.
* m4/rint.m4 (gl_FUNC_RINT): Update gl_MATHFUNC invocation.
Bruno Haible [Sat, 5 Nov 2011 16:00:34 +0000 (17:00 +0100)]
ldexpl tests: Avoid test failure on MSVC 9.
* tests/test-ldexpl.c (main): Use a temporary variable for the expected
value. Needed in order to enforce the conversion from a value greater
than LDBL_MAX to Infinity.
Paul Eggert [Fri, 4 Nov 2011 18:22:07 +0000 (11:22 -0700)]
openat: remove direct dependency on dirent
* lib/openat.h: Don't include <dirent.h>; it's no longer needed,
and hasn't been needed ever since fdopendir was split into its own
module on 2009-08-31.
* modules/openat (Depends-on): Remove dirent.
Bruno Haible [Wed, 2 Nov 2011 09:07:20 +0000 (10:07 +0100)]
New module 'fchmodat', split off from module 'openat'.
* lib/openat.h (chmodat, lchmodat): Enable only if GNULIB_FCHMODAT is
defined.
* m4/fchmodat.m4: New file, extracted from m4/openat.m4.
* m4/openat.m4 (gl_FUNC_OPENAT): Don't set GNULIB_FCHMODAT. Don't test
for fchmodat, lchmod. Don't set HAVE_FCHMODAT.
* modules/fchmodat: New file, extracted from modules/openat.
* modules/openat (Files): Remove lib/fchmodat.c.
(configure.ac): Remove AC_LIBOBJ of fchmodat.
* modules/fchmodat-tests: New file, extracted from modules/openat-tests.
* modules/openat-tests (Files): Remove tests/test-fchmodat.c.
(Makefile.am): Remove rules for test-fchmodat.
* doc/posix-functions/fchmodat.texi: Mention module 'fchmodat' instead
of module 'openat'.
* NEWS: Mention the change.
Jim Meyering [Tue, 1 Nov 2011 17:04:21 +0000 (18:04 +0100)]
gitlog-to-changelog: provide a ChangeLog-repair mechanism
Git logs are often treated as immutable, because editing them
changes the SHA1 checksums of all descendants. Thus, errors in
git logs tend to stay there forever. However, when we generate
a ChangeLog file -- typically for distribution -- from that git log,
we can actually make corrections in the generated file. The key
lies in recording in machine-readable/applicable form the desired
corrections. See --help for description and an example.
* build-aux/gitlog-to-changelog (parse_amend_file): New function.
(usage): Describe it; alphabetize option descriptions.
(main): Honor the new option, carefully.
Paul Eggert [Tue, 1 Nov 2011 20:15:14 +0000 (13:15 -0700)]
* MODULES.html.sh: Fix sed-script shell quoting and locale issues.
(func_module): Replace foo=` ... sed -e COMPLICATED ... ` with
bar=COMPLICATED; foo=` ... sed -e "$bar" ... ` when COMPLICATED
contains (possibly-quoted) backslashes. This should avoid
all-too-common shell bugs if COMPLICATED contains backslashes in
the "wrong" places. Reported by David Evans in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00013.html>.
When 'sed' uses character ranges like A-Z, invoke it in the C locale,
because we want ASCII ranges. Is there some reason we don't use
the C locale everywhere in this script?
(func_module, top level): Avoid unwanted pathname expansion when
$repo_url_prefix or $repo_url_suffix_repl contain shell
metacharacters like '?' and '*'.
Paul Eggert [Tue, 1 Nov 2011 15:22:55 +0000 (08:22 -0700)]
* tests/test-stdalign.c (TEST_ALIGNMENT): Shrink back to 8.
mingw supports alignments only up to 8 (!). Reported by Bruno Haible in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00006.html>.
* doc/posix-headers/stdalign.texi (stdalign.h): Document this.