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.
Paul Eggert [Tue, 1 Nov 2011 05:37:30 +0000 (22:37 -0700)]
stdalign: port better to MSVC and to Sun C 5.11
I think these problems were reported by Bruno Haible, in email
that I've unfortunately misplaced.
* doc/posix-headers/stdalign.texi (stdalign.h): Document more
shortcomings of MSVC and of Sun C 5.11.
* lib/stdalign.in.h (_Alignas): Omit bogus extra parenthesis
around __declspec arg.
* modules/stdalign-tests (Files): Add tests/macros.h.
* tests/test-stdalign.c: Do not include <stdlib.h>; no longer needed.
Include macros.h, for ASSERT.
(DECLARE_ALIGNED): Remove.
(TEST_ALIGNMENT): Define to 16 if alignment is supported (more likely
to catch bug), and to 1 if not (simplifies the rest of the code).
(CHECK_STATIC): Always declare the alignment test vars; that's simpler.
(CHECK_AUTO): Remove.
(CHECK_ALIGNED): Check only the alignment of the static vars,
since auto var alignment isn't supported by Sun C 5.11.
(CHECK_TYPES): Remove. All uses replaced by inline code, so that
ASSERT failures are easier to diagnose.
Dmitry V. Levin [Mon, 31 Oct 2011 15:56:52 +0000 (19:56 +0400)]
gitlog-to-changelog: fix git-log invocation
git-log mishandles date strings before 1970-01-01 UTC, and there is
no use to specify --since=1970-01-01 by default anyway.
* build-aux/gitlog-to-changelog: By default, when no --since option
was given, do not specify explicit --since option to git-log.
Jim Meyering [Sun, 30 Oct 2011 20:24:06 +0000 (21:24 +0100)]
GNUmakefile: reenable "make syntax-check" for most projects
Since Friday's commit 05e2d798, "maint.mk: don't maintain a second
build-aux variable", "syntax-check" would do nothing but succeed with
the "No version control files detected..." diagnostic (unless you
happened to override _build-aux via cfg.mk).
* top/GNUmakefile (_autoreconf, _build-aux): Move default definitions
to precede inclusion of maint.mk. Otherwise, these variables would
be used undefined in any project that does not override the default.
Dmitry V. Levin [Sun, 30 Oct 2011 01:01:00 +0000 (05:01 +0400)]
gitlog-to-changelog: treat a message with only blank lines as empty
* build-aux/gitlog-to-changelog: Move the code that removes leading and
trailing blank lines before the code that issues a warning about an
empty commit message.
Jim Meyering [Sun, 30 Oct 2011 17:12:54 +0000 (18:12 +0100)]
test-parse-datetime.c: avoid new DST-related false positive test failure
* tests/test-parse-datetime.c (gmt_offset): Determine the "gmt_offset"
based on the time/date we'll convert, not the current time.
Otherwise, the moment we cross a DST boundary like today's in
Europe, (CEST to CET), that offset ends up being one hour off.
Gary V. Vaughan [Sun, 23 Oct 2011 10:28:55 +0000 (17:28 +0700)]
maint.mk: don't maintain a second build-aux variable.
* maint.mk (build_aux): Removed. The maintainer-makefile module
depends on GNUmakefile, which already maintains a cfg.mk
overridable $(_build-aux) for projects with a non-standard
build-aux directory location, although without the $(srcdir)
prefix. Use that variable consistently instead of introducing a
second one. Adjust all call sites.
Paul Eggert [Mon, 17 Oct 2011 00:17:47 +0000 (17:17 -0700)]
crypto libraries: use stdalign
* lib/md4.c, lib/md5.c, lib/sha1.c, lib/sha256.c, lib/sha512.c:
Include <stdalign.h> and <stdint.h>. Do not include <stddef.h>.
Do not include <stdlib.h> twice, in md4.c.
(UNALIGNED_P): Simplify by using alignof. Use uintptr_t, not size_t,
because we are accessing a pointer's bit-pattern, not a size.
* modules/crypto/gc-md4 (Depends-on): Add stdalign.
* modules/crypto/gc-md5, modules/crypto/gc-sha1, modules/crypto/md4:
* modules/crypto/md5, modules/crypto/sha1, modules/crypto/sha256:
* modules/crypto/sha512: Likewise.
Bruno Haible [Thu, 27 Oct 2011 12:44:05 +0000 (14:44 +0200)]
utimensat: Work around problem on Linux/hppa.
* lib/utimensat.c (rpl_utimensat) [Linux/hppa]: Reject invalid tv_nsec
values.
* doc/posix-functions/utimensat.texi: Mention the problem on Linux/hppa.
Jim Meyering [Tue, 25 Oct 2011 10:26:49 +0000 (12:26 +0200)]
maint.mk: exempt ENODATA from a syntax-check rule
* top/maint.mk (gl_extract_significant_defines_): Also exempt ENODATA
from the sc_prohibit_always-defined_macros syntax-check rule.
Add a comment. See this for more details:
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28739/focus=28795
Jim Meyering [Sun, 23 Oct 2011 20:42:25 +0000 (22:42 +0200)]
fts: close parent dir FD before returning from post-traversal fts_read
The problem: the fts-using "mkdir -p A/B; rm -rf A" would attempt to
unlink A, even though an FD open on A remained. This is suboptimal
(holding a file descriptor open longer than needed), but otherwise not
a problem on Unix-like kernels. However, on Cygwin with certain Novell
file systems, (see http://cygwin.com/ml/cygwin/2011-10/msg00365.html),
that represents a real problem: it causes the removal of A to fail
with e.g., "rm: cannot remove `A': Device or resource busy"
fts visits each directory twice and keeps a cache (fts_fd_ring) of
directory file descriptors. After completing the final, FTS_DP,
visit of a directory, RESTORE_INITIAL_CWD intended to clear the FD
cache, but then proceeded to add a new FD to it via the subsequent
FCHDIR (which calls cwd_advance_fd and i_ring_push). Before, the
final file descriptor would be closed only via fts_close's call to
fd_ring_clear. Now, it is usually closed earlier, via the final
FTS_DP-returning fts_read call.
* lib/fts.c (restore_initial_cwd): New function, converted from
the macro. Call fd_ring_clear *after* FCHDIR, not before it.
Update callers.
Reported by Franz Sirl via the above URL, with analysis by Eric Blake
in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28739
Gary V. Vaughan [Sun, 23 Oct 2011 06:13:46 +0000 (13:13 +0700)]
readme-release: improve safety of release prep instructions.
* README-release: Don't git pull all branches when only master
is needed for the release process.
Run make maintainer-clean before changing trees and merging.
Don't try to run ./configure right after git pull in case files
that influence the bootstrap process have changed, move the
./configure step to after running ./bootstrap.
Don't bootstrap "one last time"... it's the first time!
Bruno Haible [Sat, 22 Oct 2011 12:25:26 +0000 (14:25 +0200)]
perror: Recognize when test program crashes.
* m4/perror.m4 (gl_FUNC_PERROR): If the test program crashes due to
strerror, set gl_cv_func_perror_works to no.
Reported by Daniel Richard G. <skunk@iskunk.org>.
Bruno Haible [Sat, 22 Oct 2011 11:52:56 +0000 (13:52 +0200)]
isfinite, isinf, isnan, signbit: Don't define as a macro in C++.
* lib/math.in.h (_GL_MATH_CXX_REAL_FLOATING_DECL_1,
_GL_MATH_CXX_REAL_FLOATING_DECL_2): nEW MACROS.
(isfinite, isinf, isnan, signbit): In C++, define as overloaded
functions, not as a macro.
* tests/test-math-c++.cc (REAL_FLOATING_CHECK, OVERLOADED_CHECK): New
macros.
(isfinite, isinf, isnan, signbit): Check overloaded functions and
absence of macro.
Suggested by Eric Blake.
Reported by Michael Goffioul <michael.goffioul@gmail.com>.
Bruno Haible [Fri, 21 Oct 2011 00:45:21 +0000 (02:45 +0200)]
openpty, posix_openpt: Remove code duplication.
* lib/posix_openpt.c: Add comments about platforms, from lib/openpty.c.
* lib/openpty.c: Include <stdlib.h>.
(openpty): Use posix_openpt on all platforms except IRIX.
* modules/openpty (Depends-on): Add posix_openpt. Add conditions.
Bruno Haible [Thu, 20 Oct 2011 15:44:40 +0000 (17:44 +0200)]
posix_openpt: Support for OpenBSD.
* lib/posix_openpt.c [OpenBSD]: Include <sys/ioctl.h>, <sys/tty.h>.
(posix_openpt) [OpenBSD]: New code.
* lib/grantpt.c: Include <fcntl.h>.
(grantpt) [OpenBSD]: Only test whether fd is valid, nothing else.
* modules/grantpt (Depends-on): Add fcntl-h.