gnulib.git
13 years agoUse src/ not lib/ as root of source in example Makefile.am code.
Reuben Thomas [Tue, 21 Sep 2010 12:55:05 +0000 (13:55 +0100)]
Use src/ not lib/ as root of source in example Makefile.am code.

Signed-off-by: Simon Josefsson <simon@josefsson.org>
13 years agoSet cut_dir properly, and add mode line for Emacs.
Reuben Thomas [Mon, 20 Sep 2010 21:39:56 +0000 (22:39 +0100)]
Set cut_dir properly, and add mode line for Emacs.

Signed-off-by: Simon Josefsson <simon@josefsson.org>
13 years agoSet cut_dir properly, and add mode line for Emacs.
Reuben Thomas [Tue, 21 Sep 2010 12:32:30 +0000 (14:32 +0200)]
Set cut_dir properly, and add mode line for Emacs.

Signed-off-by: Simon Josefsson <simon@josefsson.org>
13 years agoMake Makefile.am example code more cut-and-paste friendly.
Reuben Thomas [Tue, 21 Sep 2010 12:27:00 +0000 (14:27 +0200)]
Make Makefile.am example code more cut-and-paste friendly.

Signed-off-by: Simon Josefsson <simon@josefsson.org>
13 years agoNew module to test <net/if.h> interfaces.
Simon Josefsson [Tue, 21 Sep 2010 12:19:58 +0000 (14:19 +0200)]
New module to test <net/if.h> interfaces.

13 years agopthread: add pthread_spin_destroy
Paul Eggert [Mon, 20 Sep 2010 23:14:49 +0000 (16:14 -0700)]
pthread: add pthread_spin_destroy

* lib/pthread.in.h (pthread_spin_destroy): New function.

13 years agognulib-tool: Fix --help output.
Bruno Haible [Mon, 20 Sep 2010 00:09:25 +0000 (02:09 +0200)]
gnulib-tool: Fix --help output.

* gnulib-tool (func_usage): Fix help message.
Reported by Reuben Thomas <rrt@sc3d.org>.

13 years agomaint.mk: avoid unexpanded \n in two diagnostics
Jim Meyering [Sat, 18 Sep 2010 19:26:27 +0000 (21:26 +0200)]
maint.mk: avoid unexpanded \n in two diagnostics

* top/maint.mk (sc_prohibit_always_true_header_tests):
Don't use a literal \n in a halt=... assignment.  It would not be
expanded, and the two \n bytes would appear in the diagnostic output
rather than the desired newline.  Use halt=$$(printf ... instead.
(sc_vulnerable_makefile_CVE-2009-4029): Likewise.

13 years agonetinet_in: Doc tweak.
Bruno Haible [Sat, 18 Sep 2010 14:40:02 +0000 (16:40 +0200)]
netinet_in: Doc tweak.

* doc/posix-headers/netinet_in.texi: Mention an affected platform.
Reported by Mats Erik Andersson <mats.andersson@gisladisker.se>.

13 years agoinit.sh: correct an outdated comment
Jim Meyering [Sat, 18 Sep 2010 06:49:55 +0000 (08:49 +0200)]
init.sh: correct an outdated comment

* tests/init.sh (create_exe_shims_):  s/function/alias/

13 years agoinit.sh: don't let an ephemeral "*.exe" make us skip all dir entries
Jim Meyering [Sat, 18 Sep 2010 06:33:23 +0000 (08:33 +0200)]
init.sh: don't let an ephemeral "*.exe" make us skip all dir entries

Not that it's likely to happen, but if I were to remove from a PATH
directory a file named "*.exe" (yes, starting with an asterisk),
at just the right moment, it would have made init.sh ignore all
remaining .exe-suffixed names in that directory.

* tests/init.sh (find_exe_basenames_): Don't give up on a directory if
a file named "*.exe" is removed between the glob expansion and the
processing of that oddly named file.

13 years agomirbsd: add some more support
Eric Blake [Fri, 17 Sep 2010 22:36:08 +0000 (16:36 -0600)]
mirbsd: add some more support

* m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): MirBSD is
in BSD family.
* m4/gc-random.m4 (gl_GC_RANDOM): MirBSD supports same random
devices as OpenBSD.
* m4/host-os.m4 (mirbsd): Add MirBSD.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agotests: fix unportable assumption on sys/wait.h
Eric Blake [Fri, 17 Sep 2010 21:43:00 +0000 (15:43 -0600)]
tests: fix unportable assumption on sys/wait.h

* tests/test-sys_wait.c (main): Relax test.
* tests/test-stdlib.c (main): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agoinit.sh: accomodate directory with no .exes
Eric Blake [Fri, 17 Sep 2010 21:27:21 +0000 (15:27 -0600)]
init.sh: accomodate directory with no .exes

Cygwin was failing test-vc-list-files-{cvs,git}.sh, because of
spurious output on stderr.

../../tests/test-vc-list-files-cvs.sh (exe_shim): skipping directory: /home/eblake/m4-branch/build-aux

All because build-aux was a directory containing just scripts, and
no .exe extensions.  This fixes it.

* tests/init.sh: Accomodate directory containing only scripts.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agotests: avoid compiler warning
Eric Blake [Fri, 17 Sep 2010 21:09:54 +0000 (15:09 -0600)]
tests: avoid compiler warning

* tests/test-stdlib.c (main): Use the variable.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agofdutimens, fdutimensat: update signature, again
Eric Blake [Fri, 17 Sep 2010 21:08:29 +0000 (15:08 -0600)]
fdutimens, fdutimensat: update signature, again

In general, merging:

f<act>(fd,args) and <act>at(dir,name,args)

should produce:

fd<act>at(fd,dir,name,args)

* lib/utimens.h (gl_futimens): Delete, and move signature...
(fdutimens): ...here.
(fdutimensat): Rearrange signature.
(lutimensat): Rename variable for clarity.
* lib/fdutimensat.c (fdutimensat): Update signature.
* lib/utimens.c (fdutimens): Likewise.
(gl_futimens): Delete.
(utimens, lutimens): Update callers.
* lib/futimens.c (futimens): Likewise.
* tests/test-fdutimensat.c: Likewise.
* tests/test-utimens.c: Likewise.
* tests/test-futimens.h: Update comment.
* NEWS: Mention this.
Suggested by Paul Eggert.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agoTake over the maintenance of some older macros from Autoconf.
Bruno Haible [Fri, 17 Sep 2010 16:18:38 +0000 (10:18 -0600)]
Take over the maintenance of some older macros from Autoconf.

* m4/error.m4 (AC_FUNC_ERROR_AT_LINE): New macro, from GNU Autoconf.
* m4/lstat.m4 (AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): New macro, from
GNU Autoconf.
* m4/memcmp.m4 (AC_FUNC_MEMCMP): New macro, from GNU Autoconf.
* m4/mktime.m4 (AC_FUNC_MKTIME): Change comment.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agofdutimensat: drop atflag validation
Eric Blake [Fri, 17 Sep 2010 14:29:16 +0000 (08:29 -0600)]
fdutimensat: drop atflag validation

* lib/fdutimensat.c (fdutimensat): Allow AT_SYMLINK_NOFOLLOW even
with valid fd, to close a race scenario where futimens is
unsupported and FILE was replaced by a symlink.
* tests/test-fdutimensat.c (do_fdutimens, main): Adjust test
accordingly.
Suggested by Paul Eggert.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agounlockpt: Fix declaration within GNULIB_POSIXCHECK.
Bruno Haible [Fri, 17 Sep 2010 02:13:58 +0000 (04:13 +0200)]
unlockpt: Fix declaration within GNULIB_POSIXCHECK.

* lib/stdlib.in.h (unlockpt): Fix warning declaration.

13 years agologin_tty: Fix detection of function on FreeBSD, OpenBSD, NetBSD.
Bruno Haible [Fri, 17 Sep 2010 02:09:33 +0000 (04:09 +0200)]
login_tty: Fix detection of function on FreeBSD, OpenBSD, NetBSD.

* m4/pty.m4 (gl_FUNC_LOGIN_TTY): Augment LIBS while checking whether
login_tty exists.
Reported by Mats Erik Andersson <mats.andersson@gisladisker.se>.

13 years agologin_tty: Make the replacement code work on BSD systems.
Bruno Haible [Fri, 17 Sep 2010 02:05:32 +0000 (04:05 +0200)]
login_tty: Make the replacement code work on BSD systems.

* lib/login_tty.c: Include <sys/ioctl.h>.
(login_tty): Use ioctl TIOCSCTTY when available.
* modules/login_tty (Depends-on): Add sys_ioctl.
Reported by Mats Erik Andersson <mats.andersson@gisladisker.se>.

13 years agologin_tty: Stricter unit test.
Bruno Haible [Fri, 17 Sep 2010 02:00:49 +0000 (04:00 +0200)]
login_tty: Stricter unit test.

* modules/login_tty-tests (Depends-on): Add tcgetsid.
* tests/test-login_tty.c (main): Also check the results of tcgetpgrp()
and tcgetsid() after login_tty.
Reported by Mats Erik Andersson <mats.andersson@gisladisker.se>.

13 years agoNew module 'tcgetsid'.
Bruno Haible [Fri, 17 Sep 2010 01:16:53 +0000 (03:16 +0200)]
New module 'tcgetsid'.

* lib/tcgetsid.c: New file.
* m4/tcgetsid.m4: New file.
* modules/tcgetsid: New file.
* modules/termios (Depends-on): Add c++defs, warn-on-use.
(Makefile.am): Ensure c++defs.h, warn-on-use.h get included. Substitute
GNULIB_TCGETSID, HAVE_TCGETSID.
* lib/termios.in.h: Include <sys/types.h>.
(tcgetsid): New declaration.
* m4/termios_h.m4 (gl_TERMIOS_H): Check whether tcgetsid is declared.
(gl_TERMIOS_H_DEFAULTS): Initialize GNULIB_TCGETSID, HAVE_TCGETSID.
* doc/posix-functions/tcgetsid.texi: Mention the new module.
* tests/test-termios-c++.cc: Check GNULIB_NAMESPACE::tcgetsid.

13 years agoTests for module 'termios'.
Bruno Haible [Fri, 17 Sep 2010 00:09:55 +0000 (02:09 +0200)]
Tests for module 'termios'.

* modules/termios-c++-tests: New file.
* modules/termios-tests: New file.
* tests/test-termios-c++.cc: New file.
* tests/test-termios.c: New file.

13 years agoNew module 'termios'.
Bruno Haible [Fri, 17 Sep 2010 00:02:23 +0000 (02:02 +0200)]
New module 'termios'.

* modules/termios: New file.
* lib/termios.in.h: New file.
* m4/termios_h.m4: New file.
* doc/posix-headers/termios.texi: Mention the new module.

13 years agofdutimensat: add an atflag parameter
Eric Blake [Thu, 16 Sep 2010 23:12:35 +0000 (17:12 -0600)]
fdutimensat: add an atflag parameter

* lib/fdutimensat.c (fdutimensat): Add new parameter.
* lib/utimens.h (fdutimensat): Update prototype.
* tests/test-fdutimensat.c: Adjust test to match.
* NEWS: Document the change.
Suggested by Paul Eggert.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agoFix typos in comments.
Bruno Haible [Thu, 16 Sep 2010 22:23:14 +0000 (00:23 +0200)]
Fix typos in comments.

13 years agoFix typo in last commit.
Bruno Haible [Thu, 16 Sep 2010 10:54:33 +0000 (12:54 +0200)]
Fix typo in last commit.

Reported by Stefano Lattarini <stefano.lattarini@gmail.com>.

13 years agostdlib: clarify MirBSD WEXITSTATUS bug
Bruno Haible [Thu, 16 Sep 2010 00:25:57 +0000 (02:25 +0200)]
stdlib: clarify MirBSD WEXITSTATUS bug

* lib/stdlib.in.h: Clarify the MirBSD bug regarding WEXITSTATUS.
* doc/posix-headers/stdlib.texi (stdlib.h): Likewise.

13 years agostdlib: work around MirBSD WEXITSTATUS bug
Eric Blake [Wed, 15 Sep 2010 21:25:43 +0000 (15:25 -0600)]
stdlib: work around MirBSD WEXITSTATUS bug

* lib/stdlib.in.h (includes): Guarantee WEXITSTATUS.
* modules/stdlib (Depends-on): Add sys_wait.
* tests/test-sys_wait.c (main): Enhance test.
* tests/test-stdlib.c (main): Likewise.
* doc/posix-headers/stdlib.texi (stdlib.h): Document the bug.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agodocs: mention MacOS issue with WEXITSTATUS(constant)
Eric Blake [Wed, 15 Sep 2010 19:57:19 +0000 (13:57 -0600)]
docs: mention MacOS issue with WEXITSTATUS(constant)

* doc/posix-headers/sys_wait.texi (sys/wait.h): Document the
issue.
* doc/posix-headers/stdlib.texi (stdlib.h): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agostrnlen: add tests
Eric Blake [Wed, 15 Sep 2010 19:38:29 +0000 (13:38 -0600)]
strnlen: add tests

* modules/strnlen-tests: New file.
* tests/test-strnlen.c: Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agounistr/base: Avoid link errors when module 'libunistring' is also used.
Bruno Haible [Wed, 15 Sep 2010 00:43:33 +0000 (02:43 +0200)]
unistr/base: Avoid link errors when module 'libunistring' is also used.

* lib/unistr.in.h (u8_mbtouc_unsafe, u16_mbtouc_unsafe,
u32_mbtouc_unsafe, u8_mbtouc, u16_mbtouc, u32_mbtouc, u8_mbtoucr,
u16_mbtoucr, u32_mbtoucr, u8_uctomb_aux, u16_uctomb_aux, u32_uctomb):
Declare also when HAVE_LIBUNISTRING is set.
Reported by Pádraig Brady <P@draigbrady.com>.

13 years agotest-rawmemchr: make more robust
Eric Blake [Tue, 14 Sep 2010 22:42:39 +0000 (16:42 -0600)]
test-rawmemchr: make more robust

* modules/rawmemchr-tests (Files): Add zerosize-ptr.h, mmap-anon.m4.
(Depends-on, configure.ac): Add needed prerequisites to use it.
* modules/memchr-tests (Files, Depends-on, configure.ac):
Likewise, to avoid implicit reliance on memchr module prereqs.
* tests/test-memchr.c (main): Ensure proper masking.
* tests/test-rawmemchr.c (main): Likewise.  Detect oversized
reads.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agomemchr: detect glibc Alpha bug
Eric Blake [Tue, 14 Sep 2010 19:43:07 +0000 (13:43 -0600)]
memchr: detect glibc Alpha bug

Avoids http://sourceware.org/bugzilla/show_bug.cgi?id=12019.

* m4/memchr.m4 (gl_FUNC_MEMCHR): Detect glibc 2.11.2 failure on
Alpha.
* doc/posix-functions/memchr.texi (memchr): Tweak wording.
* tests/test-memchr.c (main): Enhance test.
Reported by Nelson H. F. Beebe.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agofts, getcwd, glob: audit for dirfd returning -1
Paul Eggert [Tue, 14 Sep 2010 16:03:55 +0000 (09:03 -0700)]
fts, getcwd, glob: audit for dirfd returning -1

* lib/fts.c (opendir): Remove #define; no longer used.
(opendirat): New arg PDIR_FD.  All callers changed.
(fts_build, _opendir2): Use new opendirat to avoid the need for
dirfd, or for checking whether dirfd returns a negative value.
Don't use opendir; always use openat followed by fdopendir.
* lib/getcwd.c (__getcwd): Don't reset fd; fdopendir no longer clobbers
it.
* lib/glob.c (link_exists_p): Add comment explaining why dirfd never
returns -1 here.
* modules/fts (Depends-on): Remove dirfd.
* modules/getcwd (Depends-on): Likewise.

13 years agofloat: fix broken MirBSD header
Eric Blake [Mon, 13 Sep 2010 20:33:22 +0000 (14:33 -0600)]
float: fix broken MirBSD header

* m4/float_h.m4 (gl_FLOAT_H): MirBSD copied OpenBSD's bug.
* doc/posix-headers/float.texi (float.h): Document it.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agofts: use O_NOFOLLOW to avoid race condition when opening a directory
Paul Eggert [Mon, 13 Sep 2010 19:38:41 +0000 (12:38 -0700)]
fts: use O_NOFOLLOW to avoid race condition when opening a directory

* lib/fts.c (opendirat): New arg extra_flags.
(__opendir2): Use it to avoid following symlinks when opening
a directory, if symlinks are not supposed to be followed.  See
<http://lists.gnu.org/archive/html/bug-gnulib/2010-09/msg00213.html>.

13 years agofdopendir: preserve argument fd before returning
Paul Eggert [Mon, 13 Sep 2010 19:21:47 +0000 (12:21 -0700)]
fdopendir: preserve argument fd before returning

* lib/fdopendir.c: Adjust comments to say POSIX, not Solaris.
(fdopendir_with_dup, fd_clone_opendir): New static functions.
(fdopendir): Use them, arranging for FD to be open to the same
directory that it was when it started.  (It might be temporarily
closed while fdopendir is running, so this not thread- or
signal-safe.)  Be careful to do the right thing even when file
descriptors are scarce and dup fails with errno == EMFILE.  See
<http://lists.gnu.org/archive/html/bug-gnulib/2010-09/msg00208.html>.

13 years agoregex: Pass the system regex if its only problem is 32-bit regoff_t.
Paolo Bonzini [Thu, 9 Sep 2010 08:14:02 +0000 (10:14 +0200)]
regex: Pass the system regex if its only problem is 32-bit regoff_t.

* NEWS: Document change.
* m4/regex.m4: Disable test for regoff_t size.

13 years agofts: don't operate on an invalid file descriptor after failed dup
Jim Meyering [Mon, 13 Sep 2010 05:29:18 +0000 (07:29 +0200)]
fts: don't operate on an invalid file descriptor after failed dup

* lib/fts.c (fts_build): Don't call set_cloexec_flag on a
negative file descriptor.

13 years agosavedir: add streamsavedir, deprecate fdsavedir
Paul Eggert [Sun, 12 Sep 2010 21:21:52 +0000 (14:21 -0700)]
savedir: add streamsavedir, deprecate fdsavedir

* NEWS: Mention deprecation of fdsavedir.
* lib/savedir.c (streamsavedir): New extern function, whose name
ends in "savedir" to be consistent with the others.  This differs
from savedirstream in that it doesn't close its argument.  The
next version of GNU tar will use this instead of fdsavedir, to
avoid some race conditions and conserve file descriptors.
(savedirstream): Reimplement as a wrapper around streamsavedir.
(fdsavedir): Add a comment deprecating this function.  As far as
I know, only GNU tar used it, and GNU tar doesn't need it any more.
* lib/savedir.h (streamsavedir): New decl.
(fdsavedir): Add a comment deprecating this.

13 years agoautoupdate
Karl Berry [Sat, 11 Sep 2010 13:31:07 +0000 (06:31 -0700)]
autoupdate

13 years agolanginfo: Fix last commit.
Bruno Haible [Fri, 10 Sep 2010 21:19:03 +0000 (23:19 +0200)]
langinfo: Fix last commit.

* m4/langinfo_h.m4 (gl_LANGINFO_H): Initialize
HAVE_LANGINFO_T_FMT_AMPM, HAVE_LANGINFO_YESEXPR.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.

13 years agorelocatable-prog-wrapper: Fix compilation failure due to O_EXEC.
Bruno Haible [Fri, 10 Sep 2010 19:42:19 +0000 (21:42 +0200)]
relocatable-prog-wrapper: Fix compilation failure due to O_EXEC.

* lib/progreloc.c (O_EXEC): Define fallback.

13 years agoImprove NEWS entry.
Bruno Haible [Fri, 10 Sep 2010 19:45:46 +0000 (21:45 +0200)]
Improve NEWS entry.

13 years ago* NEWS: Document recent changes to fcntl-h.
Paul Eggert [Fri, 10 Sep 2010 19:26:03 +0000 (12:26 -0700)]
* NEWS: Document recent changes to fcntl-h.

13 years agofcntl-h: define O_CLOEXEC and O_EXEC if not defined; use new defines
Paul Eggert [Fri, 10 Sep 2010 18:55:27 +0000 (11:55 -0700)]
fcntl-h: define O_CLOEXEC and O_EXEC if not defined; use new defines

* doc/posix-headers/fcntl.texi (fcntl.h): Document that
O_CLOEXEC is now defined to 0 if it is not defined, like other flags.
Also, O_EXEC is now defined to be O_RDONLY if O_EXEC is not defined.
Similarly for O_SEARCH; this last was already true, but not documented.
* lib/fcntl.in.h (O_CLOEXEC): Define to 0 if not defined.
* lib/dup-safer-flag.c (O_CLOEXEC): Remove now-useless #define.
* lib/dup3.c, lib/pipe2.c, tests/test-dup-safer.c, tests/test-fcntl.c:
Likewise.
* lib/popen-safer.c (open_noinherit): Check whether O_CLOEXEC
is zero, not whether it is defined.
* tests/test-dup3.c, tests/test-pipe2.c (main): Likewise.
* lib/progreloc.c (find_executable): Use O_EXEC rather than O_RDONLY.
* lib/open.c (open): Check for O_SEARCH as well as for O_RDONLY.

13 years agolanginfo, nl_langinfo: Fix for IRIX 5.3.
Bruno Haible [Fri, 10 Sep 2010 18:23:49 +0000 (20:23 +0200)]
langinfo, nl_langinfo: Fix for IRIX 5.3.

* m4/langinfo_h.m4 (gl_LANGINFO_H): Test whether langinfo.h defines
T_FMT_AMPM, YESEXPR. Set HAVE_LANGINFO_T_FMT_AMPM,
HAVE_LANGINFO_YESEXPR.
* modules/langinfo (Makefile.am): Substitute HAVE_LANGINFO_T_FMT_AMPM,
HAVE_LANGINFO_YESEXPR.
* lib/langinfo.in.h (T_FMT_AMPM, GNULIB_defined_T_FMT_AMPM): Define if
HAVE_LANGINFO_T_FMT_AMPM is 0.
(YESEXPR, NOEXPR, GNULIB_defined_YESEXPR): Define if
HAVE_LANGINFO_YESEXPR is 0.
* lib/nl_langinfo.c (rpl_nl_langinfo): Handle also T_FMT_AMPM, YESEXPR,
NOEXPR.
* doc/posix-headers/langinfo.texi: Mention the IRIX 5.3 problem.
* doc/posix-functions/nl_langinfo.texi: Likewise.
Reported by Eric Blake.

13 years agopty, readutmp: Fix for FreeBSD 8.0 and OpenBSD 4.6.
Bruno Haible [Fri, 10 Sep 2010 10:02:44 +0000 (12:02 +0200)]
pty, readutmp: Fix for FreeBSD 8.0 and OpenBSD 4.6.

* doc/glibc-functions/login_tty.texi: Mention the include file problem
on FreeBSD 8.0 and OpenBSD 4.6.
* lib/pty.in.h: Include <sys/types.h> before <libutil.h>.
* m4/pty_h.m4 (gl_PTY_H): Likewise.
* m4/pty.m4 (gl_FUNC_FORKPTY, gl_FUNC_OPENPTY): Likewise.
* m4/readutmp.m4 (gl_READUTMP): Include <sys/types.h> before <utmp.h>.
Invoke AC_INCLUDES_DEFAULT instead of using the undocumented variable
ac_includes_default.
Reported by Mats Erik Andersson <mats.andersson@gisladisker.se>.

13 years agostrsignal: work around NetBSD bug
Eric Blake [Thu, 9 Sep 2010 23:05:15 +0000 (17:05 -0600)]
strsignal: work around NetBSD bug

* m4/strsignal.m4 (gl_FUNC_STRSIGNAL): Also check in <unistd.h>.
* lib/string.in.h (includes): Likewise.
* doc/posix-functions/strsignal.texi (strsignal): Document the
bug.
Reported by Nelson H. F. Beebe.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agognulib-tool: work with NetBSD /bin/sh
Eric Blake [Thu, 9 Sep 2010 23:06:15 +0000 (17:06 -0600)]
gnulib-tool: work with NetBSD /bin/sh

* gnulib-tool (func_cache_var, func_cache_lookup_module)
(func_get_description, func_get_comment, func_get_status)
(func_get_notice, func_get_applicability, func_get_filelist)
(func_get_dependencies, func_get_autoconf_early_snippet)
(func_get_autoconf_snippet, func_get_automake_snippet)
(func_get_include_directive, func_get_link_directive)
(func_get_license, func_get_maintainer, func_import): Avoid
shell syntax errors from parsing syntax extensions.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agoautoupdate
Karl Berry [Thu, 9 Sep 2010 22:01:25 +0000 (15:01 -0700)]
autoupdate

13 years agognulib-tool: Avoid stderr output on IRIX related to 'alias', 'unalias'.
Bruno Haible [Thu, 9 Sep 2010 09:39:51 +0000 (11:39 +0200)]
gnulib-tool: Avoid stderr output on IRIX related to 'alias', 'unalias'.

* gnulib-tool: Don't fiddle with file descriptors 0, 1, 2. Instead, use
a reliable way to determine whether the 'alias' command works.

13 years agoinit.sh: penalize a set-x-impaired shell; don't disqualify it
Jim Meyering [Wed, 8 Sep 2010 20:24:22 +0000 (22:24 +0200)]
init.sh: penalize a set-x-impaired shell; don't disqualify it

* tests/init.sh: Too many shells corrupt application stderr when
you set -x, so we can't afford to disqualify them, since at least
on Irix-6.5, that would disqualify all bourne shells.
Instead, use a more discerning approach.
When iterating through candidate shells, give each a score
of 10 for perfect, 9 if corrupts stderr upon set -x but passes
all other tests, and some other value if it is unacceptable.
Use the first shell that gets a score of 10.
If no shell scores 10, use the first that scored 9.
Finally, when VERBOSE=yes is requested and set -x might cause trouble, simply
issue a warning and refrain from enabling debug output.

13 years agounsetenv: fix OpenBSD bug
Eric Blake [Wed, 8 Sep 2010 19:43:51 +0000 (13:43 -0600)]
unsetenv: fix OpenBSD bug

* m4/setenv.m4 (gl_FUNC_UNSETENV): Check for OpenBSD bug.
* doc/posix-functions/unsetenv.texi (unsetenv): Update
documentation.
Reported by Jim Meyering.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agostrtod: work around IRIX 6.5 bug
Eric Blake [Thu, 2 Sep 2010 03:34:44 +0000 (21:34 -0600)]
strtod: work around IRIX 6.5 bug

IRIX mis-parses "1e 1" as 10.0 and "" instead of 1.0 and "e 1".
Because the original parse may differ from the reparse in terms
of whether the value overflows, we have to do an errno dance.

* lib/strtod.c (strtod): Reparse number on shorter string if
exponent parse was invalid.
* tests/test-strtod.c (main): Add check for "0x1p 2".
Reported by Tom G. Christensen.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agoautoupdate
Karl Berry [Wed, 8 Sep 2010 15:07:01 +0000 (08:07 -0700)]
autoupdate

13 years agomaint: fix ChangeLog ordering
Eric Blake [Wed, 8 Sep 2010 15:02:44 +0000 (09:02 -0600)]
maint: fix ChangeLog ordering

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agogetopt: optimize previous patch
Eric Blake [Wed, 8 Sep 2010 14:49:15 +0000 (08:49 -0600)]
getopt: optimize previous patch

* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Correctly check for
empty variable.  Speed up awk script.
Reported by Paolo Bonzini.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agoinit.sh: disqualify shells for which set -x corrupts stderr
Jim Meyering [Wed, 8 Sep 2010 13:18:46 +0000 (15:18 +0200)]
init.sh: disqualify shells for which set -x corrupts stderr

* tests/init.sh: Add a test to disqualify /bin/sh from SunOS 5.11
and OpenBSD 4.7.  They make it so with "set -x", environment settings
appear in stderr output.  For example, this command:
    /bin/sh -c 'set -x; P=1 true 2> err' 2>/dev/null; cat err
prints "P=1" on those two systems:

13 years agognulib-tool: Avoid stderr output on IRIX related to 'alias', 'unalias'.
Bruno Haible [Wed, 8 Sep 2010 08:44:26 +0000 (10:44 +0200)]
gnulib-tool: Avoid stderr output on IRIX related to 'alias', 'unalias'.

* gnulib-tool: Use stderr redirection around the 'alias' and 'unalias'
commands, because some shells ignore redirections when there is an
error in the command lookup.
Reported by Eric Blake.

13 years agoFix formatting of ChangeLog entry.
Bruno Haible [Wed, 8 Sep 2010 08:04:11 +0000 (10:04 +0200)]
Fix formatting of ChangeLog entry.

13 years agoregex documentation update from Reuben Thomas <rrt@sc3d.org>, 20 Aug 2010 12:04:39...
Karl Berry [Wed, 8 Sep 2010 00:45:39 +0000 (17:45 -0700)]
regex documentation update from Reuben Thomas <rrt@sc3d.org>, 20 Aug 2010 12:04:39 +0100

13 years agoregex documentation update from Reuben Thomas <rrt@sc3d.org>, 20 Aug 2010 12:04:39...
Karl Berry [Wed, 8 Sep 2010 00:44:22 +0000 (17:44 -0700)]
regex documentation update from Reuben Thomas <rrt@sc3d.org>, 20 Aug 2010 12:04:39 +0100

13 years agogetopt: handle POSIXLY_CORRECT set but not exported
Eric Blake [Tue, 7 Sep 2010 18:10:38 +0000 (12:10 -0600)]
getopt: handle POSIXLY_CORRECT set but not exported

* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Restore pre-existing
export state of POSIXLY_CORRECT.
Reported by Dustin J. Mitchell.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agognulib-tool: Highlight the changed options.
Bruno Haible [Sun, 5 Sep 2010 09:28:47 +0000 (11:28 +0200)]
gnulib-tool: Highlight the changed options.

* gnulib-tool (func_usage): Display the --import, --add-import,
--remove-import explanations in bold font.

13 years agoupdate from texinfo
Karl Berry [Tue, 7 Sep 2010 00:17:55 +0000 (17:17 -0700)]
update from texinfo

13 years agodoc tweaks
Karl Berry [Mon, 6 Sep 2010 17:34:36 +0000 (10:34 -0700)]
doc tweaks

13 years agouniwidth/width: Update comment.
Bruno Haible [Sun, 5 Sep 2010 08:42:02 +0000 (10:42 +0200)]
uniwidth/width: Update comment.

* lib/uniwidth/width.c (uc_width): Update comment for Unicode >= 3.1.
Reported by Emanuele Giaquinta <emanuele.giaquinta@gmail.com>.

13 years agoisinf, isnan: Relax license.
Bruno Haible [Sun, 5 Sep 2010 08:33:21 +0000 (10:33 +0200)]
isinf, isnan: Relax license.

* modules/isinf (License): Change from GPL to LGPL, with consent from
Ben Pfaff.
* modules/isnan (License): Likewise.
Requested by Ludovic Courtès.

13 years agognulib-tool: Help migration from --import to --add-import or --update.
Bruno Haible [Sat, 4 Sep 2010 18:29:56 +0000 (20:29 +0200)]
gnulib-tool: Help migration from --import to --add-import or --update.

* gnulib-tool: Emit a verbose error message when --import is used
without any module name.

13 years agoUpdate doc about gnulib-tool.
Bruno Haible [Sat, 4 Sep 2010 17:28:12 +0000 (19:28 +0200)]
Update doc about gnulib-tool.

* doc/gnulib-tool.texi (VCS Issues): Explain 'gnulib-tool --import' vs.
'gnulib-tool --update' in more detail.
Reported by Eric Blake.

13 years agognulib-tool: Change --import. New options --add/remove-import.
Bruno Haible [Sat, 4 Sep 2010 16:39:03 +0000 (18:39 +0200)]
gnulib-tool: Change --import. New options --add/remove-import.

* gnulib-tool: New options --add-import, --remove-import.
(func_usage): Document them.
(have_associative): Define always.
(func_import): In import mode, don't merge the specified settings with
the cached settings. Implement remove-import mode.
* doc/gnulib-tool.texi (Modified imports): Mention the new options.
Explain when to use them versus --import.
(Simple update): Use --add-import instead of --import.
* NEWS: Mention the change.

13 years agoDoc update.
Bruno Haible [Sat, 4 Sep 2010 13:28:09 +0000 (15:28 +0200)]
Doc update.

13 years agognulib-tool: Don't talk about CVS any more.
Bruno Haible [Sat, 4 Sep 2010 13:07:47 +0000 (15:07 +0200)]
gnulib-tool: Don't talk about CVS any more.

* gnulib-tool (func_usage, func_import): Write "version control"
instead of CVS.

13 years agomaint.mk: avoid obscure sc_copyright_check failure in coreutils
Jim Meyering [Sat, 4 Sep 2010 16:16:04 +0000 (18:16 +0200)]
maint.mk: avoid obscure sc_copyright_check failure in coreutils

* top/maint.mk (v_etc_file): Prepend $(gnulib_dir)/, to avoid
false positives (whose names may be ill-chosen) when searching
non-VC'd files.  Otherwise, a file named "a b/lib/version-etc.c"
would cause a false-positive.

13 years agognulib-tool: Fix expression that counts directories.
Bruno Haible [Sat, 4 Sep 2010 15:47:30 +0000 (17:47 +0200)]
gnulib-tool: Fix expression that counts directories.

13 years agoavoid coreutils "make distcheck" failure
Jim Meyering [Sat, 4 Sep 2010 15:43:39 +0000 (17:43 +0200)]
avoid coreutils "make distcheck" failure

Coreutils tests with an absolute build directory name that contains
a space.  Not quoting this directory name caused a failure.
* tests/test-vc-list-files-git.sh: Quote PATH dir name.
* tests/test-vc-list-files-cvs.sh: Likewise.

13 years agognulib-tool: Avoid error when run in a package without Makefile.am.
Bruno Haible [Sat, 4 Sep 2010 15:38:58 +0000 (17:38 +0200)]
gnulib-tool: Avoid error when run in a package without Makefile.am.

* gnulib-tool: When collecting the m4dirs in a package that does not
have a Makefile.am, eliminate those directories that contain no
gnulib-cache.m4.

13 years agoupdate-copyright test: Improve output when perl is missing or too old.
Bruno Haible [Sat, 4 Sep 2010 11:58:02 +0000 (13:58 +0200)]
update-copyright test: Improve output when perl is missing or too old.

* tests/test-update-copyright.sh: Move test of Perl version down after
the test whether Perl exists. Provide an explanation relating Perl's
error message to Automake's SKIP: message.

13 years agoDon't augment PATH in TESTS_ENVIRONMENT.
Bruno Haible [Sat, 4 Sep 2010 11:46:42 +0000 (13:46 +0200)]
Don't augment PATH in TESTS_ENVIRONMENT.

* modules/update-copyright-tests (Makefile.am): In TESTS_ENVIRONMENT,
set abs_aux_dir instead of augmenting PATH.
* modules/vc-list-files-tests (Makefile.am): Likewise.
* tests/test-update-copyright.sh: Augment PATH here.
* tests/test-vc-list-files-cvs.sh: Augment PATH here, through
path_prepend_.
* tests/test-vc-list-files-git.sh: Likewise.

13 years agotests: prohibit augmenting PATH via TESTS_ENVIRONMENT
Jim Meyering [Sat, 4 Sep 2010 10:45:22 +0000 (12:45 +0200)]
tests: prohibit augmenting PATH via TESTS_ENVIRONMENT

* Makefile (sc_prohibit_augmenting_PATH_via_TESTS_ENVIRONMENT): New rule.

13 years agostrdup: Fix compilation error in C++ mode.
Bruno Haible [Sat, 4 Sep 2010 11:40:30 +0000 (13:40 +0200)]
strdup: Fix compilation error in C++ mode.

* lib/string.in.h (strdup): In C++ mode with GNULIB_NAMESPACE, undefine
the macro.

13 years agodirfd: Fix compilation error in C++ mode on MacOS X, *BSD, IRIX.
Bruno Haible [Sat, 4 Sep 2010 11:35:19 +0000 (13:35 +0200)]
dirfd: Fix compilation error in C++ mode on MacOS X, *BSD, IRIX.

* lib/dirent.in.h (dirfd): In C++ mode with GNULIB_NAMESPACE, turn the
macro into a function.
Reported by Jarno Rajahalme <jarno.rajahalme@nsn.com>.

13 years agoSet PATH_SEPARATOR the same way autoconf does.
Bruno Haible [Sat, 4 Sep 2010 09:16:43 +0000 (11:16 +0200)]
Set PATH_SEPARATOR the same way autoconf does.

* build-aux/relocatable.sh.in (func_find_curr_installdir): Determine
the value of PATH_SEPARATOR the same way autoconf-generated configure
scripts do.
* m4/lib-ld.m4 (AC_LIB_PROG_LD): Likewise.
* m4/progtest.m4 (AM_PATH_PROG_WITH_TEST): Likewise.

13 years agoSet PATH_SEPARATOR the same way autoconf does.
Stefano Lattarini [Sat, 4 Sep 2010 09:01:27 +0000 (11:01 +0200)]
Set PATH_SEPARATOR the same way autoconf does.

* gnulib-tool (func_gnulib_dir): Determine the value of PATH_SEPARATOR
the same way autoconf-generated configure scripts do.
* posix-modules: Likewise.

13 years agoautoupdate
Karl Berry [Fri, 3 Sep 2010 13:07:11 +0000 (06:07 -0700)]
autoupdate

13 years agotests: init.sh improvements for re-exec'ing with zsh
Eric Blake [Thu, 2 Sep 2010 19:49:41 +0000 (13:49 -0600)]
tests: init.sh improvements for re-exec'ing with zsh

Tom's IRIX setup had a broken bash, and proceeded to run zsh
outside of POSIX mode.  But trying to trace that setup proved
difficult, since the re-exec lost tracing.

* tests/init.sh: Borrow autoconf POSIX-mode sanitization.  Pass
-vx through shell re-exec.
Reported by Tom G. Christensen.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agohash: fix safe_hasher const typo
Paul Eggert [Thu, 2 Sep 2010 19:51:40 +0000 (12:51 -0700)]
hash: fix safe_hasher const typo

* lib/hash.c (safe_hasher): Result is pointer, not pointer to
const; otherwise, there is a type error later.

13 years agotest-update-copyright.sh: require perl 5.8.0
Jim Meyering [Thu, 2 Sep 2010 15:53:36 +0000 (17:53 +0200)]
test-update-copyright.sh: require perl 5.8.0

* tests/test-update-copyright.sh: Require 5.8.0,
which Tom G. Christensen has confirmed is adequate,
while 5.6.1 is not.

13 years agowctype: fix typo in previous commit
Eric Blake [Thu, 2 Sep 2010 14:49:58 +0000 (08:49 -0600)]
wctype: fix typo in previous commit

* m4/wctype_h.m4 (gl_WCTYPE_H): Fix spelling.
Reported by Ludovic Courtès.

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agotest-update-copyright.sh: skip test if Perl is too old
Jim Meyering [Thu, 2 Sep 2010 11:51:56 +0000 (13:51 +0200)]
test-update-copyright.sh: skip test if Perl is too old

* tests/test-update-copyright.sh: Exit 77 if Perl is too old.
Reported by Tom G. Christensen.

13 years agowctype: Avoid compilation error on IRIX 6.5.30.
Bruno Haible [Thu, 2 Sep 2010 09:15:39 +0000 (11:15 +0200)]
wctype: Avoid compilation error on IRIX 6.5.30.

* lib/wctype.in.h (iswblank): Declare with a replacement if
REPLACE_ISWBLANK is set.
* m4/wctype_h.m4 (gl_WCTYPE_H): Check also whether iswblank is
declared. Set REPLACE_ISWBLANK.
* modules/wctype (Makefile.am): Substitute REPLACE_ISWBLANK.
* doc/posix-functions/iswblank.texi: Mention the IRIX 6.5.30 problem.
* doc/posix-headers/wctype.texi: Likewise.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.

13 years agoNew module 'socketlib'.
Bruno Haible [Thu, 2 Sep 2010 08:45:43 +0000 (10:45 +0200)]
New module 'socketlib'.

* modules/socketlib: New file.
* m4/socketlib.m4: New file, extracted from m4/sockets.m4.
* m4/sockets.m4 (gl_SOCKETS): Require gl_SOCKETLIB.
* modules/sockets (Depends-on): Add socketlib.
Suggested by Sam Steingold <sds@gnu.org>.

13 years agofcntl-h, etc.: prefer O_SEARCH to O_RDONLY when applicable
Paul Eggert [Wed, 1 Sep 2010 20:45:53 +0000 (13:45 -0700)]
fcntl-h, etc.: prefer O_SEARCH to O_RDONLY when applicable

POSIX 2008 specifies a new 'open' flag O_SEARCH, which can be used
when one needs search access to a directory but not read access.
On systems where it is available, it works in some cases where
O_RDONLY does not, namely on directories that are searchable but
not readable, and which need only to be searchable.  If O_SEARCH
is not available, fall back to the traditional method of using
O_RDONLY.

* lib/fcntl.in.h (O_SEARCH): #define to O_RDONLY if not defined.
* lib/chdir-long.c (cdb_advance_fd): Use O_SEARCH, not O_RDONLY,
when opening a directory that needs only to be searchable.
* lib/chdir-safer.c (chdir_no_follow): Likewise.
* lib/fts.c (diropen, fts_open, fd_ring_check): Likewise.
* lib/openat-proc.c (openat_proc_name): Likewise.
* lib/openat.c (openat_needs_fchdir): Likewise.
* lib/save-cwd.c (save_cwd): Likewise.
* lib/savewd.c (savewd_save, savewd_chdir): Likewise.

13 years agoautoupdate
Karl Berry [Wed, 1 Sep 2010 13:43:13 +0000 (06:43 -0700)]
autoupdate

13 years agoNew module 'host-cpu-c-abi'.
Bruno Haible [Tue, 31 Aug 2010 21:57:08 +0000 (23:57 +0200)]
New module 'host-cpu-c-abi'.

13 years agohash: factor, and guard against misbehaving hasher function
Eric Blake [Tue, 31 Aug 2010 08:10:32 +0000 (10:10 +0200)]
hash: factor, and guard against misbehaving hasher function

* lib/hash.c (safe_hasher): New function, to encapsulate the checking
of table->hasher's return value.  Also protect against a hash value
so large that adding it to table->bucket results in a NULL pointer.
(hash_lookup, hash_get_next, hash_find_entry, transfer_entries):
Use it in place of open-coded check-and-abort.

13 years agohash: silence spurious clang warning
Bruno Haible [Tue, 31 Aug 2010 06:43:53 +0000 (08:43 +0200)]
hash: silence spurious clang warning

* lib/hash.c (hash_get_next): Remove unnecessary test against NULL.
Reported by Eric Blake.