gnulib.git
10 years agoverify: new macro 'assume'
Paul Eggert [Thu, 3 Oct 2013 04:59:38 +0000 (21:59 -0700)]
verify: new macro 'assume'

This is taken from Emacs, and should be generally useful.
* doc/verify.texi (assume): Document it.
* lib/verify.h (assume): New macro.
(__has_builtin): Expand to 0 if not defined.

10 years agoautoupdate
Karl Berry [Tue, 1 Oct 2013 14:14:32 +0000 (07:14 -0700)]
autoupdate

10 years agodup2, dup3: work around another cygwin crasher
Eric Blake [Thu, 26 Sep 2013 13:07:07 +0000 (07:07 -0600)]
dup2, dup3: work around another cygwin crasher

Cygwin 1.7.25 can crash due to an off-by-one bug on an attempt to
duplicate a file into the current RLIMIT_NOFILE soft limit, when
that limit is smaller than the hard limit.  The intent in the
cygwin code was to allow the dup and auto-increase the soft limit,
which is itself questionable (and which we work around in the
gnulib getdtablesize module); but avoiding the crash is worth
doing even if the soft limit semantics are wrong.

http://cygwin.com/ml/cygwin/2013-09/msg00397.html
http://cygwin.com/ml/cygwin-developers/2013-q3/msg00010.html

* m4/dup2.m4 (gl_FUNC_DUP2): Expose the bug.
* m4/dup3.m4 (gl_FUNC_DUP3): Likewise.
* tests/test-dup2.c (main): Likewise.
* lib/dup2.c (rpl_dup2): Use setdtablesize to avoid it.
* lib/dup3.c (dup3): Likewise.
* doc/posix-functions/dup2.texi (dup2): Document it.
* doc/glibc-functions/dup3.texi (dup3): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agogetdtablesize: work around cygwin issue
Eric Blake [Thu, 26 Sep 2013 17:26:29 +0000 (11:26 -0600)]
getdtablesize: work around cygwin issue

Cygwin 1.7.25 has a bug that even though it claims to support
RLIMIT_NOFILE inheritance, there is no enforcement of the soft
limit, and getdtablesize() automatically grows until it reaches
the hard limit which cannot be changed by setrlimit().  Best is
to just treat things as an invariant limit, as several other
modules assume that getdtablesize() will not change without an
intervening setrlimit().

* m4/getdtablesize.m4 (gl_FUNC_GETDTABLESIZE): Detect problem.
* modules/getdtablesize (configure.ac): Build replacement.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Set up a witness.
* modules/unistd (Makefile.am): Expose the witness.
* lib/unistd.in.h (getdtablesize): Declare replacement.
* lib/getdtablesize.c (rpl_getdtablesize): Work around it.
* tests/test-getdtablesize.c (main): Test it.
* doc/glibc-functions/getdtablesize.texi (getdtablesize): Document it.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agopmccabe2html: escaping of special characters
Mats Erik Andersson [Wed, 25 Sep 2013 20:27:03 +0000 (22:27 +0200)]
pmccabe2html: escaping of special characters

The C code characters '<', '>', and '&' were improperly
escaped in HTML output, and their multiplicity was ignored.

10 years agomanywarnings: enable nicer gcc warning messages
Eric Blake [Tue, 24 Sep 2013 12:33:40 +0000 (06:33 -0600)]
manywarnings: enable nicer gcc warning messages

With gcc 4.3.4, -Wdisabled-optimization is noisy unless you also
use -funit-at-a-time.

With gcc 4.4.7, there is no indication which warning option
triggered a particular message unless you also use
-fdiagnostics-show-option.

Both of these options are default in newer gcc (such as 4.8.1);
but including them in the list of possible warnings makes the
experience nicer on older platforms.

* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Older gcc requires
some -f options for optimal warnings.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agotimespec: use the new TIMESPEC_RESOLUTION in a few more places
Jim Meyering [Sat, 21 Sep 2013 16:11:49 +0000 (09:11 -0700)]
timespec: use the new TIMESPEC_RESOLUTION in a few more places

* lib/timespec-add.c (timespec_add): Also replace 999999999
with TIMESPEC_RESOLUTION - 1.
* lib/timespec-sub.c (timespec_sub): Likewise.

10 years agowarnings: port --enable-gcc-warnings to Solaris Studio 12.3
Paul Eggert [Mon, 23 Sep 2013 17:16:13 +0000 (10:16 -0700)]
warnings: port --enable-gcc-warnings to Solaris Studio 12.3

Problem reported by Dagobert Michelsen via Eric Blake in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-09/msg00052.html>.
* m4/warnings.m4 (gl_COMPILER_OPTION_IF): Use AC_LINK_IFELSE,
not AC_COMPILE_IFELSE.

10 years agoconfigmake: support new --runstatedir option
Eric Blake [Thu, 12 Sep 2013 22:23:31 +0000 (16:23 -0600)]
configmake: support new --runstatedir option

http://lwn.net/Articles/436012/ documents that many distros
are now preferring to use /run rather than /var/run for
storage of pid files and other per-process temporary files
that must not be cleaned out during arbitrary TMPDIR sweeps.
As such, the GNU Coding Standards were recently changed to
recommend a new configure option to make it easy to choose
this directory at configure time, and autoconf 2.70 will
support the new directory by default.  This patch adds support
for propagating results of the new option (for new enough
autotools) or providing a sane default (for older autotools)
into C code.

* m4/configmake.m4 (gl_CONFIGMAKE_PREP): Substitute runstatedir
even if autoconf was too old to provide the command line option.
* modules/configmake (Makefile.am): Propagate it to .h file.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoctype, string: depend on extern-inline
Paul Eggert [Mon, 23 Sep 2013 04:25:25 +0000 (21:25 -0700)]
ctype, string: depend on extern-inline

This is needed to complete the recent OS X fixes.
Also, fix related documentation as suggested by Eric Blake.
* doc/posix-functions/isalnum.texi, doc/posix-functions/isalpha.texi:
* doc/posix-functions/isascii.texi, doc/posix-functions/iscntrl.texi:
* doc/posix-functions/isdigit.texi, doc/posix-functions/isgraph.texi:
* doc/posix-functions/islower.texi, doc/posix-functions/isprint.texi:
* doc/posix-functions/ispunct.texi, doc/posix-functions/isspace.texi:
* doc/posix-functions/isupper.texi, doc/posix-functions/isxdigit.texi:
* doc/posix-functions/toascii.texi, doc/posix-functions/tolower.texi:
* doc/posix-functions/toupper.texi:
List the 'ctype' gnulib module.
* doc/posix-functions/strcat.texi, doc/posix-functions/strcpy.texi:
* doc/posix-functions/strncpy.texi:
List the 'string' gnulib module.
* modules/memcpy, modules/memmove, modules/memset (Depends-on):
Add string.
* modules/ctype, modules/string (Depends-on): Add extern-inline.

10 years agouserspec: support optional parameters to parse_user_spec()
Pádraig Brady [Fri, 20 Sep 2013 02:51:27 +0000 (03:51 +0100)]
userspec: support optional parameters to parse_user_spec()

* lib/userspec.c (parse_user_spec): If the GID param is NULL,
then avoid group processing and treat the full spec as a user.
(parse_with_separator): Allow the USERNAME and GROUPNAME to
be optional params (NULL), in which case they're ignored.
* tests/test-userspec.c (main): Ensure NULL params are ignored.

10 years agotimespec: new function make_timespec, and new constants
Paul Eggert [Thu, 19 Sep 2013 21:12:29 +0000 (14:12 -0700)]
timespec: new function make_timespec, and new constants

* lib/timespec.h: Incorporate recent changes on the Emacs trunk.
(TIMESPEC_RESOLUTION, LOG10_TIMESPEC_RESOLUTION): New constants.
(make_timespec): New function.
* lib/dtotimespec.c (dtotimespec):
* lib/timespec-add.c (timespec_add):
* lib/timespec-sub.c (timespec_sub):
* lib/utimens.c (validate_timespec):
* lib/utimensat.c (rpl_utimensat):
Use these new constants and functions.

10 years agostdio: OS X port of putc_unlocked + extern inline
Paul Eggert [Thu, 19 Sep 2013 20:25:43 +0000 (13:25 -0700)]
stdio: OS X port of putc_unlocked + extern inline

* lib/stdio.in.h (putc_unlocked): #undef on problematic Apple platforms.
* doc/posix-functions/putc_unlocked.texi:
* doc/posix-functions/putchar_unlocked.texi:
Document this portability problem.

10 years agosignal: OS X port of sigaddset etc. + extern inline
Paul Eggert [Thu, 19 Sep 2013 20:24:03 +0000 (13:24 -0700)]
signal: OS X port of sigaddset etc. + extern inline

* lib/signal.in.h (sigaddset, sigdelset, sigemptyset, sigfillset)
(sigismember): #undef on problematic Apple platforms.
* doc/posix-functions/sigaddset.texi:
* doc/posix-functions/sigdelset.texi:
* doc/posix-functions/sigemptyset.texi:
* doc/posix-functions/sigfillset.texi:
* doc/posix-functions/sigismember.texi:
Document this portability problem.

10 years agoextern-inline: do not always suppress extern inline on OS X
Paul Eggert [Thu, 19 Sep 2013 20:21:39 +0000 (13:21 -0700)]
extern-inline: do not always suppress extern inline on OS X

* m4/extern-inline.m4 (gl_EXTERN_INLINE): Suppress the use of
extern inline on Apple only if the particular compile-time
configuration is known to have the problem.
(_GL_EXTERN_INLINE_APPLE_BUG): New private macro, to implement this.
(_GL_EXTERN_LNLINE_IN_USE): New macro, intended for use by
other Gnulib modules.

10 years agoextern-inline: document fixes for ctype and wctype macros
Paul Eggert [Thu, 19 Sep 2013 19:57:18 +0000 (12:57 -0700)]
extern-inline: document fixes for ctype and wctype macros

* doc/posix-functions/isalnum.texi, doc/posix-functions/isalpha.texi:
* doc/posix-functions/isascii.texi, doc/posix-functions/isblank.texi:
* doc/posix-functions/iscntrl.texi, doc/posix-functions/isdigit.texi:
* doc/posix-functions/isgraph.texi, doc/posix-functions/islower.texi:
* doc/posix-functions/isprint.texi, doc/posix-functions/ispunct.texi:
* doc/posix-functions/isspace.texi, doc/posix-functions/isupper.texi:
* doc/posix-functions/iswalnum.texi, doc/posix-functions/iswalpha.texi:
* doc/posix-functions/iswcntrl.texi, doc/posix-functions/iswctype.texi:
* doc/posix-functions/iswdigit.texi, doc/posix-functions/iswgraph.texi:
* doc/posix-functions/iswlower.texi, doc/posix-functions/iswprint.texi:
* doc/posix-functions/iswpunct.texi, doc/posix-functions/iswspace.texi:
* doc/posix-functions/iswupper.texi, doc/posix-functions/iswxdigit.texi:
* doc/posix-functions/isxdigit.texi, doc/posix-functions/toascii.texi:
* doc/posix-functions/memcpy.texi, doc/posix-functions/memmove.texi:
* doc/posix-functions/memset.texi, doc/posix-functions/stpcpy.texi:
* doc/posix-functions/stpncpy.texi, doc/posix-functions/strcat.texi:
* doc/posix-functions/strcpy.texi, doc/posix-functions/strncat.texi:
* doc/posix-functions/strncpy.texi:
* doc/posix-functions/tolower.texi, doc/posix-functions/toupper.texi:
* doc/posix-functions/towlower.texi, doc/posix-functions/towupper.texi:
Document that Gnulib fixes portability problems with these
functions on OS X 10.8 and earlier when called from plain inline
or extern inline functions.

10 years agofflush, freadahead, fseeko: Fix for Android
Kevin Cernekee [Sat, 7 Sep 2013 03:00:38 +0000 (20:00 -0700)]
fflush, freadahead, fseeko: Fix for Android

* lib/stdio-impl.h: Use local __sfileext definition.

Suggested by Bruno Haible in:
<http://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00306.html>

fflush, freadahead, and fseeko have trouble compiling on Android[1]
because they need access to internal elements of the FILE struct.
Bionic libc[2], like OpenBSD libc[3], puts the ungetc buffer "_ub"
at the beginning of the __sfileext struct.  Therefore we can reuse the
existing OpenBSD implementation for Android.

Test results (Android 4.2.2, ARMv7, NDK r9):

    root@android:/data/local/tmp # export srcdir=`pwd`
    root@android:/data/local/tmp # ./test-fflush2.sh ; echo $?
    0
    root@android:/data/local/tmp # ./test-freadahead.sh ; echo $?
    0
    root@android:/data/local/tmp # ./test-fseeko.sh ; echo $?
    0
    root@android:/data/local/tmp # ./test-fseeko2.sh ; echo $?
    Skipping test: ungetc cannot handle arbitrary bytes
    77
    root@android:/data/local/tmp # ./test-fseeko3.sh ; echo $?
    0
    root@android:/data/local/tmp # ./test-fseeko4.sh ; echo $?
    0

[1] http://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00295.html
[2] https://android.googlesource.com/platform/bionic/+/android-4.3_r2.2/libc/stdio/fileext.h
[3] http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=1.2;content-type=text%2Fplain

10 years agopmccabe2html: fix portability issues
Mats Erik Andersson [Thu, 19 Sep 2013 17:47:29 +0000 (19:47 +0200)]
pmccabe2html: fix portability issues

Allow awk versions other than Gawk.
Correct wrong HTML tag closures.

10 years agogetgroups: statement without effect
Mats Erik Andersson [Wed, 18 Sep 2013 16:04:26 +0000 (18:04 +0200)]
getgroups: statement without effect

* lib/getgroups.c (rpl_getgroups) [HAVE_GETGROUPS]:
Change equality conditional to expected assignment.

10 years agoautoupdate
Karl Berry [Fri, 13 Sep 2013 22:25:29 +0000 (15:25 -0700)]
autoupdate

10 years agoupdate from texinfo
Karl Berry [Fri, 13 Sep 2013 14:02:33 +0000 (07:02 -0700)]
update from texinfo

10 years agoupdate from texinfo
Karl Berry [Wed, 11 Sep 2013 16:29:59 +0000 (09:29 -0700)]
update from texinfo

10 years agoglob: fix compilation
Eric Blake [Mon, 9 Sep 2013 12:23:44 +0000 (06:23 -0600)]
glob: fix compilation

Sometimes, it just isn't my day.  The previous patch missed an #endif.

* lib/glob.in.h (__THROW): Fix missing line in previous commit.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoglob: fix build for platforms without __THROW
Eric Blake [Sat, 7 Sep 2013 13:23:32 +0000 (07:23 -0600)]
glob: fix build for platforms without __THROW

The previous fix for glibc broke builds on non-glibc platforms
that don't pre-define __THROW.  Perhaps we could make the code
more optimal by using gcc attributes instead of expanding to
nothing, to match the glibc usage; but for now this fixes the
build.  Reproted by Tom G. Christensen.

* lib/glob.in.h (__THROW): Add definition again.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoautoupdate
Karl Berry [Fri, 6 Sep 2013 12:36:05 +0000 (05:36 -0700)]
autoupdate

10 years agoregex-quote: fix buffer access out of bounds
Anton Ovchinnikov [Thu, 5 Sep 2013 00:09:39 +0000 (17:09 -0700)]
regex-quote: fix buffer access out of bounds

http://lists.gnu.org/archive/html/bug-gnulib/2013-09/msg00001.html
* lib/regex-quote.c (regex_quote_spec_pcre):
Fix typo that resulted in an out-of-bounds read.

10 years agoglob: avoid -Wattribute warnings on glibc
Eric Blake [Wed, 4 Sep 2013 23:06:35 +0000 (17:06 -0600)]
glob: avoid -Wattribute warnings on glibc

Colin Watson reported that some versions of gcc warn about the use
of attribute((leaf)) on static functions, since it is documented to
have an effect only on external functions.

* lib/glob.c (next_brace_sub, prefix_array, collated_compare): Use
__THROWNL, not __THROW, on static functions.
* lib/glob.in.h (__THROW): Adjust...
(__THROWNL): ...accordingly.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoheaders: check that _GL_INLINE_HEADER_BEGIN is defined
Paul Eggert [Thu, 29 Aug 2013 01:49:38 +0000 (18:49 -0700)]
headers: check that _GL_INLINE_HEADER_BEGIN is defined

Suggested by Bruce Korb in:
http://lists.gnu.org/archive/html/bug-gnulib/2013-08/msg00070.html
* doc/extern-inline.texi (extern inline):
Suggest checking that _GL_INLINE_HEADER_BEGIN is defined.
* lib/acl-internal.h, lib/argp-fmtstream.h, lib/argp.h:
* lib/binary-io.h, lib/bitrotate.h, lib/count-leading-zeros.h:
* lib/count-one-bits.h, lib/eealloc.h, lib/execinfo.in.h:
* lib/gethrxtime.h, lib/gl_list.h, lib/gl_oset.h, lib/gl_xlist.h:
* lib/gl_xoset.h, lib/gl_xsublist.h, lib/glthread/cond.h:
* lib/glthread/thread.h, lib/math.in.h, lib/mbchar.h, lib/mbfile.h:
* lib/mbiter.h, lib/mbuiter.h, lib/openat.h, lib/pipe-filter-aux.h:
* lib/priv-set.h, lib/pthread.in.h, lib/savewd.h, lib/se-context.in.h:
* lib/se-selinux.in.h, lib/sig-handler.h, lib/stat-time.h:
* lib/sys_socket.in.h, lib/timespec.h, lib/u64.h, lib/unistd.in.h:
* lib/utimens.h, lib/wctype.in.h, lib/xalloc.h, lib/xsize.h:
* lib/xtime.h:
Check that _GL_INLINE_HEADER_BEGIN is defined.

10 years agobootstrap: remove the --version requirement from ancillary tools
Pádraig Brady [Sun, 18 Aug 2013 01:05:51 +0000 (02:05 +0100)]
bootstrap: remove the --version requirement from ancillary tools

* build-aux/bootstrap (check_exists): A new refactored function to
determine if a command exists.
(find_tool): Use the new function which does not require the
--version option to be supported.
(check_versions): Use the new function.

10 years agogc: support HMAC-SHA256 and HMAC-SHA512.
Simon Josefsson [Mon, 26 Aug 2013 19:31:15 +0000 (21:31 +0200)]
gc: support HMAC-SHA256 and HMAC-SHA512.

* lib/gc.h: Add gc_hmac_sha256 and gc_hmac_sha512.
* lib/gc-libgcrypt.c (gc_hmac_sha256, gc_hmac_sha512): New
functions.
(gc_hmac_md5): Use symbolic constant.
* lib/gc-gnulib.c: Include hmac.h for HMAC-SHA256/512 too.
(gc_hmac_sha256, gc_hmac_sha512): New functions.
* lib/hmac.h: Add hmac_sha256 and hmac_sha512 prototypes.
* m4/sha256.m4: Protect against empty expansion.
* m4/sha512.m4: Likewise.
* lib/hmac-sha256.c: New file.
* lib/hmac-sha512.c: Likewise.
* m4/gc-hmac-sha256.m4: Likewise.
* m4/gc-hmac-sha512.m4: Likewise.
* m4/gc-sha256.m4: Likewise.
* m4/gc-sha512.m4: Likewise.
* modules/crypto/gc-hmac-sha256: Likewise.
* modules/crypto/gc-hmac-sha256-tests: Likewise.
* modules/crypto/gc-hmac-sha512: Likewise.
* modules/crypto/gc-hmac-sha512-tests: Likewise.
* modules/crypto/hmac-sha256: Likewise.
* modules/crypto/hmac-sha256-tests: Likewise.
* modules/crypto/hmac-sha512: Likewise.
* modules/crypto/hmac-sha512-tests: Likewise.
* tests/test-gc-hmac-sha256.c: Likewise.
* tests/test-gc-hmac-sha512.c: Likewise
* tests/test-hmac-sha256.c: Likewise.
* tests/test-hmac-sha512.c: Likewise

10 years agogettext: update to version 0.18.3.1
Daiki Ueno [Sat, 24 Aug 2013 08:29:35 +0000 (10:29 +0200)]
gettext: update to version 0.18.3.1

* m4/intl.m4: Update from gettext-0.18.3.1, which fixes a misuse
of AC_CHECK_DECLS.

10 years agoselinux-at: omit unnecessary include
Paul Eggert [Fri, 23 Aug 2013 20:53:46 +0000 (13:53 -0700)]
selinux-at: omit unnecessary include

* lib/selinux-at.c: Don't include dosname.h; not needed, since
this source file doesn't use its macros, and subsidiary files that
use the macros already include it.

10 years agoautoupdate
Karl Berry [Thu, 22 Aug 2013 22:18:26 +0000 (15:18 -0700)]
autoupdate

10 years agod-ino: avoid false negative on symlink
Eric Blake [Wed, 21 Aug 2013 22:10:18 +0000 (16:10 -0600)]
d-ino: avoid false negative on symlink

If the first entry listed in a directory is a symlink, we
had a spurious mismatch between d_ino (which should match the
symlink) and stat() results (which chases the symlink).
Reported by Stephane Chazelas <stephane.chazelas@gmail.com>.

* m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Use lstat.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoupdate from texinfo
Karl Berry [Tue, 20 Aug 2013 18:06:51 +0000 (11:06 -0700)]
update from texinfo

10 years agoautoupdate
Karl Berry [Fri, 16 Aug 2013 13:32:22 +0000 (06:32 -0700)]
autoupdate

10 years agobootstrap: port to OpenBSD sed
Mike Miller [Tue, 13 Aug 2013 03:39:29 +0000 (23:39 -0400)]
bootstrap: port to OpenBSD sed

* build-aux/bootstrap (insert_if_absent): Port to OpenBSD sed which
does not interpret `-' as a file argument to mean stdin.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agowarnings: minor optimization
Eric Blake [Thu, 15 Aug 2013 19:45:55 +0000 (13:45 -0600)]
warnings: minor optimization

Paul Eggert suggested that expr is more efficient than echo|sed.

* m4/warnings.m4 (gl_COMPILER_OPTION_IF): Use fewer processes.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agowarnings: check -Wfoo rather than -Wno-foo
Eric Blake [Wed, 14 Aug 2013 23:02:58 +0000 (17:02 -0600)]
warnings: check -Wfoo rather than -Wno-foo

As reported by Christophe Fergeau and others, use of the
warnings modules is awkward when probing for negative
warning flags.  For example, clang recognizes
-Wno-unused-command-line-argument, but gcc does not;
gcc silently ignores unknown warnings in isolation, but when
something else also causes a compilation problem, gcc then
compounds the overall message by also complaining about the
unrecongized command line option at that time.  The gcc manual
documents that this behavior is intentional so that someone
can add a -Wno-foo silencer to CFLAGS for a warning that older
gcc does not understand, and where the warning is undesired
under newer gcc; it also documents that probing for the -Wfoo
positive form of the error is a reliable way to tell if the
negative form will actually suppress anything.  Clang will
warn for both positive and negative forms of an unknown
option.

Since common usage includes:

for w in $list; do
  gl_WARN_ADD([$w])
done

the solution must be polymorphic to work on both m4 literals
and shell variables (similar to AS_VAR_SET polymorphism).

* m4/warnings.m4 (gl_COMPILER_OPTION_IF): If name begins with
-Wno-, test if the compiler recognizes the positive form instead.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoaccept doclicense option
Karl Berry [Thu, 15 Aug 2013 18:01:29 +0000 (11:01 -0700)]
accept doclicense option

10 years agoaccept doclicense option
Karl Berry [Thu, 15 Aug 2013 18:01:13 +0000 (11:01 -0700)]
accept doclicense option

10 years agoxvasprintf-tests: port to GCC with hardening flags
Paul Eggert [Tue, 13 Aug 2013 20:47:29 +0000 (13:47 -0700)]
xvasprintf-tests: port to GCC with hardening flags

* tests/test-xvasprintf.c (test_xasprintf): Pass another arg to
xasprintf, to pacify GCC.  Reported by Santiago Vila in:
http://lists.gnu.org/archive/html/bug-diffutils/2013-08/msg00002.html

10 years agofpending: port to recent Cygwin change to stdio_ext.h
Paul Eggert [Sun, 11 Aug 2013 23:36:16 +0000 (16:36 -0700)]
fpending: port to recent Cygwin change to stdio_ext.h

Reported by LRN in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-08/msg00028.html>.
* lib/fpending.h: Don't worry about HAVE_DECL___FPENDING;
just declare __fpending unless it's a macro.
A duplicate decl shouldn't hurt.
* m4/fpending.m4 (gl_FUNC_FPENDING): Check that an __fpending
call compiles and links, instead of separately checking for
decl and lib function.
* modules/fpending (configure-ac):
Adjust to fpending.m4's renaming of shell variable.

10 years agono need for tendentious comment
Karl Berry [Sun, 11 Aug 2013 15:35:08 +0000 (08:35 -0700)]
no need for tendentious comment

10 years agoregenerate
Karl Berry [Sun, 11 Aug 2013 15:31:43 +0000 (08:31 -0700)]
regenerate

10 years agoautoupdate
Karl Berry [Sun, 11 Aug 2013 15:30:18 +0000 (08:30 -0700)]
autoupdate

10 years agosys_time: port to OpenBSD
Paul Eggert [Sun, 11 Aug 2013 05:02:58 +0000 (22:02 -0700)]
sys_time: port to OpenBSD

* lib/sys_time.in.h: Simply delegate to the system's header
in the BSDish cases as well.  Problem reported by Mike Miller in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-08/msg00016.html>.
* tests/test-sys_select.c, tests/test-sys_time.c (verify_tv_sec_type):
Allow platforms like 64-bit OpenBSD where timeval's tv_sec is
wider than time_t.

10 years agoautoupdate
Karl Berry [Sat, 10 Aug 2013 14:10:55 +0000 (07:10 -0700)]
autoupdate

10 years agobootstrap: support checksum utils without a --status option
Pádraig Brady [Thu, 8 Aug 2013 10:08:49 +0000 (11:08 +0100)]
bootstrap: support checksum utils without a --status option

* build-aux/bootstrap: Only look for sha1sum if updating po files.
Add sha1 to the list of supported checksum utils since it's now
supported through adjustments below.
(update_po_files): Remove the use of --status
in a way that will suppress all error messages, but since this is
only used to minimize updates, it shouldn't cause an issue.
Exit early if there is a problem updating the po file checksums.
(find_tool): Remove the check for --version support as this
is optional as per commit 86186b17.  Don't even check for the
presence of the command as if that is needed, it's supported
through configuring prerequisites in bootstrap.conf.
Prompt that when a tool isn't found, one can define an environment
variable to add to the hardcoded search list.

10 years agoupdate from texinfo
Karl Berry [Fri, 9 Aug 2013 16:27:34 +0000 (09:27 -0700)]
update from texinfo

10 years agoFix ChangeLog typo.
Paul Eggert [Fri, 9 Aug 2013 15:49:19 +0000 (08:49 -0700)]
Fix ChangeLog typo.

10 years agoautoupdate
Karl Berry [Fri, 9 Aug 2013 15:03:30 +0000 (08:03 -0700)]
autoupdate

10 years agoregex: port to non-glibc/lock-using systems
Jim Meyering [Mon, 5 Aug 2013 18:24:26 +0000 (11:24 -0700)]
regex: port to non-glibc/lock-using systems

Since 29-05-2013 commit, 55ba71f4, compilation on a non-glibc
system with GNULIB_LOCK would fail due to absence of the
included "glthread/lock.h".  This would affect any package
for which the "lock" module is used only by the regex module,
and not explicitly used.
* m4/regex.m4 (gl_PREREQ_REGEX): Require gl_GLIBC21.
* modules/regex (Depends-on) [!GLIBC && $ac_use_included_regex]:
Add a dependency on the "lock" module.

10 years agoupdate from texinfo
Karl Berry [Tue, 6 Aug 2013 17:57:33 +0000 (10:57 -0700)]
update from texinfo

10 years agoautoupdate
Karl Berry [Sat, 20 Jul 2013 21:38:08 +0000 (14:38 -0700)]
autoupdate

10 years agolocalecharset: make locale_charset thread-safe on Mac OS X
Daiki Ueno [Sat, 20 Jul 2013 14:03:38 +0000 (07:03 -0700)]
localecharset: make locale_charset thread-safe on Mac OS X

* lib/localcharset.c (locale_charset) [DARWIN7]: Use MB_CUR_MAX_L
instead of MB_CUR_MAX.

10 years agogettext: update to version 0.18.3
Daiki Ueno [Sat, 20 Jul 2013 01:23:31 +0000 (18:23 -0700)]
gettext: update to version 0.18.3

* m4/intl.m4, m4/po.m4: Update from gettext-0.18.3.  In particular,
require AC_PROG_SED to allow user to specify custom sed command when
generating en@quot PO file.

10 years agoautoupdate
Karl Berry [Fri, 19 Jul 2013 22:08:53 +0000 (15:08 -0700)]
autoupdate

10 years agobootstrap: use correct source when copying build-aux files
Werner LEMBERG [Fri, 21 Jun 2013 22:52:22 +0000 (00:52 +0200)]
bootstrap: use correct source when copying build-aux files

in my setup for ttfautohint (http://repo.or.cz/w/ttfautohint.git) I
have the following assignment in `bootstrap.conf':

  build_aux=gnulib

It seems that the patch below is necessary to make this really work
(at least it works for me): if I understand the issue correctly,
$build_aux is a *destination* variable, so it must not be used for the
files listed in $gnulib_extra_files which uses the directory structure
of the `gnulib' repository.

* build-aux/bootstrap (gnulib_extra_files): This variable is
relative to upstream gnulib layout, not downstream.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agotmpdir: fix bug in VMS port
Paul Eggert [Wed, 17 Jul 2013 13:03:43 +0000 (06:03 -0700)]
tmpdir: fix bug in VMS port

* lib/tmpdir.c (path_search) [__VMS]: Never add slash.
See Steven M. Schweda in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-07/msg00026.html>.

10 years agotmpdir: fix typo in previous change
Paul Eggert [Mon, 15 Jul 2013 21:43:20 +0000 (14:43 -0700)]
tmpdir: fix typo in previous change

10 years ago* lib/tmpdir.c: Simplify code to add slash; no need for a loop.
Paul Eggert [Mon, 15 Jul 2013 20:32:24 +0000 (13:32 -0700)]
* lib/tmpdir.c: Simplify code to add slash; no need for a loop.

10 years agotmpdir: port to VMS, to // != /, and to long dirs
Paul Eggert [Mon, 15 Jul 2013 16:44:19 +0000 (09:44 -0700)]
tmpdir: port to VMS, to // != /, and to long dirs

* lib/tmpdir.c (__libc_secure_getenv) [!_LIBC]: Rename from
__secure_getenv, so that we're more like the glibc version.
All uses changed.
(path_search): Don't put slash after directory if __VMS.
Problem reported by Steven M. Schweda in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-07/msg00019.html>.
Do not remove trailing slash from "//".
Do not assume dlen <= INT_MAX.

10 years agoregex: port to --with-included-regex --enable-gcc-warnings non-threaded
Paul Eggert [Tue, 9 Jul 2013 18:35:01 +0000 (11:35 -0700)]
regex: port to --with-included-regex --enable-gcc-warnings non-threaded

* lib/regex_internal.h (lock_fini, lock_lock): Rework to avoid
gcc warnings in the non-threaded case.  Reported by Charlie Brown in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-07/msg00015.html>.

10 years agoaccept4, dup3, pipe2: port to Cygwin
Paul Eggert [Tue, 9 Jul 2013 17:00:58 +0000 (10:00 -0700)]
accept4, dup3, pipe2: port to Cygwin

Problem reported for Emacs by Ken Brown in <http://bugs.gnu.org/14821>.
* lib/accept4.c (accept4) [O_BINARY]:
* lib/dup3.c (dup3) [O_BINARY]:
* lib/pipe2.c (pipe2) [O_BINARY]:
Use set_binary_mode, not setmode.
* lib/pipe2.c [!GNULIB_BINARY_IO]: Include binary-io.h.
* modules/binary-io (Depends-on): Remove module indicator.
These last two bits undo the previous change to pipe2 and binary-io.

10 years agomountlist: add support for deallocating returned list entries
Pádraig Brady [Tue, 9 Jul 2013 12:55:58 +0000 (13:55 +0100)]
mountlist: add support for deallocating returned list entries

* lib/mountlist.c (free_mount_entry): A new exported function
to deallocate a mount list entry.
* lib/mountlist.h: Declare the new function.
(read_file_system_list): Refactor to use the new deallocation function.
Suggested by Anton Ovchinnikov.

10 years agostdalign, verify: port to FreeBSD 9.1, to C11, and to C++11
Paul Eggert [Mon, 8 Jul 2013 06:06:26 +0000 (23:06 -0700)]
stdalign, verify: port to FreeBSD 9.1, to C11, and to C++11

Problem reported by Ulrich Mueller in <http://bugs.gnu.org/14812>.
* lib/stdalign.in.h (_Alignas, _Alignof):
Port to FreeBSD 9.1, and to C11 and C++11.
(_Alignas): Also support ICC.
* lib/verify.h (_Static_assert): Undef if <stddef.h> defines it.
* m4/stdalign.m4 (gl_STDALIGN_H): Port to ICC and to C++11.

10 years agofnmatch: don't goto over declaration
Paul Eggert [Sun, 7 Jul 2013 00:12:29 +0000 (17:12 -0700)]
fnmatch: don't goto over declaration

* lib/fnmatch_loop.c (FCT): Hoist local up one level, to avoid
undefined behavior for goto over a declaration.
Problem reported by Charlie Brown in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-07/msg00009.html>.

10 years agopipe2: decouple from binary-io a bit
Paul Eggert [Sat, 6 Jul 2013 08:35:26 +0000 (01:35 -0700)]
pipe2: decouple from binary-io a bit

This is for Emacs, which needs pipe2 but not binary-io.
* lib/pipe2.c [!GNULIB_BINARY_IO]: Don't include binary-io.h.
* modules/binary-io (Depends-on): Add module indicator.

10 years agomgetgroups: relax license to LGPLv2+
Eric Blake [Wed, 3 Jul 2013 21:45:04 +0000 (15:45 -0600)]
mgetgroups: relax license to LGPLv2+

getgrouplist is part of glibc and LGPLv2+; the mgetgroups module
is merely an ease-of-use wrapper around this interface.  There's
nothing in the algorithm worth protecting by the more-restrictive
GPLv3+.  See also this thread.
https://lists.gnu.org/archive/html/bug-gnulib/2013-05/msg00092.html

* modules/getugroups (License): Change from GPLv3+.
* modules/mgetgroups (License): Likewise.
* modules/getgroups (License): Change from LGPLv3+.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoxalloc-oversized: relax license to LGPLv2+
Eric Blake [Wed, 3 Jul 2013 21:38:07 +0000 (15:38 -0600)]
xalloc-oversized: relax license to LGPLv2+

Unlike the bulk of xalloc* which calls exit() on allocation failure,
and thus is unacceptable in a library, the xalloc-oversized.h header
is a mere macro that makes checks for allocation overflow possible in
all sorts of portable code.  In fact, the LGPLv2+ module malloca
already has a copy of this check, arguing that this header is more
useful under a permissive license.  See also this thread.
https://lists.gnu.org/archive/html/bug-gnulib/2013-05/msg00092.html

* modules/xalloc-oversized (License): Change from GPLv3+.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agonproc: relax license to LGPLv2+
Eric Blake [Wed, 3 Jul 2013 21:34:30 +0000 (15:34 -0600)]
nproc: relax license to LGPLv2+

nproc merely exposes alternatives to sysconf(_SC_NPROCESSORS_CONF),
which is part of glibc and thus LGPLv2+; it is not adding any value
that strategically requires LGPLv3+.  See also this thread.
https://lists.gnu.org/archive/html/bug-gnulib/2013-05/msg00105.html

* modules/nproc (License): Change from LGPLv3+.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agobootstrap: honor --no-git
Eric Blake [Wed, 3 Jul 2013 19:48:58 +0000 (13:48 -0600)]
bootstrap: honor --no-git

Based on a report by Chandrashekar Shastri, at
https://bugzilla.redhat.com/show_bug.cgi?id=979360

The intent behind the original addition of --no-git in commit
824f8d16 was to allow builds on a machine that either has no
git, or where git is prevented from using the network; yet where
the user had other means of checking out the correct version of
gnulib (such as using an NFS share).  But in practice, we were
still trying to use git, in spite of being told where gnulib-tool
already lives.  This fixes bootstrap to match the original
intent, by avoiding all direct use of git or submodules (any
indirect use of git, such as by autopoint, is beyond our control;
but at least that use does not require network access).  It is
still up to the end user to ensure that GNULIB_SRCDIR points
to the intended gnulib commit.

* build-aux/bootstrap: Don't even try to use git when user is
pointing to a static checkout.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoupdate from texinfo
Karl Berry [Sun, 23 Jun 2013 23:49:41 +0000 (16:49 -0700)]
update from texinfo

10 years agoignore-value: port to gcc -pedantic
Paul Eggert [Sun, 23 Jun 2013 18:51:27 +0000 (11:51 -0700)]
ignore-value: port to gcc -pedantic

* lib/ignore-value.h (ignore_value):
Port to gcc -pedantic, by using __extension__.
Reindent as per usual gnulib style nowadays.
Simplify GCC version check.

10 years agoextern-inline: port to gcc -std=c89
Paul Eggert [Fri, 21 Jun 2013 19:33:40 +0000 (12:33 -0700)]
extern-inline: port to gcc -std=c89

* m4/extern-inline.m4 (gl_EXTERN_INLINE):
Do not use __gnu_inline__ if pedantic and pre-C99.

10 years agodoc: document extern-inline
Paul Eggert [Tue, 18 Jun 2013 21:23:03 +0000 (14:23 -0700)]
doc: document extern-inline

* doc/extern-inline.texi: New file.
* doc/gnulib.texi (alloca-opt): Include it.
* m4/extern-inline.m4: Move some comments to documentation,
and others closer to what they describe.

10 years agodoc: chatter less
Paul Eggert [Tue, 18 Jun 2013 21:18:36 +0000 (14:18 -0700)]
doc: chatter less

* doc/Makefile (NEWEST_GNULIB_TEXI_FILE): New macro.
(updated-stamp): Use it.  This causes 'make' to output just
one file name rather than zillions.

10 years agofflush, fseeko: port to musl cross-compiles
Paul Eggert [Tue, 18 Jun 2013 20:07:00 +0000 (13:07 -0700)]
fflush, fseeko: port to musl cross-compiles

* lib/fseeko.c (fseeko): Assume that fflushing stdin works if
on some implementation that (1) is not known to be buggy,
(2) claims conformance to POSIX.1-2008 or later, and (3) is being
cross-compiled to so we can't easily check for lack of
conformance.  This is for cross-compiling to musl.
Reported by Rich Felker in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-06/msg00043.html>.
* m4/fclose.m4 (gl_FUNC_FCLOSE):
* m4/fflush.m4 (gl_FUNC_FFLUSH):
* m4/fseeko.m4 (gl_FUNC_FSEEKO):
Adjust to above change.
* m4/fflush.m4 (gl_FUNC_FFLUSH_STDIN): Set gl_cv_func_fflush_stdin
to 'cross', not to 'no', when cross-compiling.  AC_DEFINE
FUNC_FFLUSH_STDIN to 1, 0, -1 if fflushing stdin is known to work,
known not to work, or unknown.

10 years agomsvc-inval: port to mingw-w64
Paul Eggert [Sun, 16 Jun 2013 00:24:24 +0000 (17:24 -0700)]
msvc-inval: port to mingw-w64

* lib/msvc-inval.c (gl_msvc_invalid_parameter_handler):
Use __cdecl, not cdecl, for mingw-w64.  Reported by LRN in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-06/msg00039.html>.

10 years agogetcwd-lgpl: port to Tru64
Paul Eggert [Wed, 12 Jun 2013 02:52:46 +0000 (19:52 -0700)]
getcwd-lgpl: port to Tru64

* lib/getcwd-lgpl.c: Include <stdlib.h>, for malloc etc.
Problem reported by Steven M. Schweda in
<http://lists.gnu.org/archive/html/bug-gzip/2013-06/msg00010.html>.

10 years agoautoupdate
Karl Berry [Tue, 11 Jun 2013 13:04:55 +0000 (06:04 -0700)]
autoupdate

10 years agotests: port large-fd POSIX spawn tests to OS X
Paul Eggert [Tue, 11 Jun 2013 07:10:21 +0000 (00:10 -0700)]
tests: port large-fd POSIX spawn tests to OS X

Problem reported by Daiki Ueno in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-06/msg00031.html>.
* tests/test-posix_spawn_file_actions_addclose.c:
* tests/test-posix_spawn_file_actions_adddup2.c:
* tests/test-posix_spawn_file_actions_addopen.c:
Include <limits.h>, for OPEN_MAX, if available.
(big_fd): New static function.
(main): Use it.

10 years agoautoupdate
Karl Berry [Fri, 7 Jun 2013 13:44:05 +0000 (06:44 -0700)]
autoupdate

10 years agotests/nap.h: use an adaptive delay to avoid ctime update issues
Bernhard Voelker [Wed, 5 Jun 2013 07:20:15 +0000 (09:20 +0200)]
tests/nap.h: use an adaptive delay to avoid ctime update issues

The recent change in nap.h (5191133e) decreased the probability of lost
races to about a third, however such problems could still be observed
in virtual machines and openSUSE's OBS.

Instead of calulating the nap() time once and using it (together with
a small correction multiplier), avoid the race alltogether by verifying
on a reference file whether a timestamp difference has happened.

Before, nap() detected the needed time once empirically and then used
that delay (together with a small correction multiplier) in further
calls.  This problem has been reported and discussed several times,
including guesses about possible kernel issues:
  https://lists.gnu.org/archive/html/bug-gnulib/2013-04/msg00071.html
  http://lists.gnu.org/archive/html/coreutils/2012-03/msg00088.html
  https://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00226.html
  http://bugs.gnu.org/12820
  https://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00113.html
  https://lists.gnu.org/archive/html/bug-gnulib/2009-11/msg00007.html

Now, nap() avoids the race alltogether by verifying on a reference
file whether a timestamp difference has happened.

* tests/nap.h (nap_fd): Define file descriptor variable for the
witness file.
(nap_works): Change return value to bool.  Change passing
the old file's status by value instead of by reference as this function
does no longer update that timestamp; rename the function argument from
st to old_st.  Remove the local variables cdiff and mdiff because that
function now returns true/false instead of the precise delay.
(guess_delay): Remove function.
(clear_tmp_file): Add new function to close and unlink the witness file.
(nap): Instead of re-using the delay which has been calculated during
the first call, avoid the race by actually verifying that a timestamp
difference can be observed on the current file system.  Use an adaptive
approach for the delay to minimize execution time.  Assert that the
maximum delay is <= ~2 seconds, more precisely sum(2^n) from 0 to 30
= 2^31 - 1 = 2.1s.
Use atexit to call clear_tmp_file when the process terminates.

10 years agosig2str: port to C++
Paul Eggert [Sun, 2 Jun 2013 18:52:41 +0000 (11:52 -0700)]
sig2str: port to C++

* lib/sig2str.h (sig2str, str2sig): Declare as extern "C".
Reported by Daniel J Sebald in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-06/msg00000.html>.

10 years agodocs: mention cygwin shortcoming in <sys/un.h>
Eric Blake [Thu, 30 May 2013 17:27:45 +0000 (11:27 -0600)]
docs: mention cygwin shortcoming in <sys/un.h>

I'm not quite ready to implement a replacement <sys/un.h> that
automatically works around this problem, since making the replacement
work for mingw seems much harder; so for now I'm just documenting
the issue I hit.

* doc/posix-headers/sys_un.texi (sys/un.h): Mention problem.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agovasnprintf: silence mingw compiler warning
Eric Blake [Wed, 29 May 2013 23:47:50 +0000 (17:47 -0600)]
vasnprintf: silence mingw compiler warning

On mingw, vasnprintf is able to use snprintf, but not its return
value; this led to a situation where gcc warns:

vasnprintf.c: In function 'vasnprintf':
vasnprintf.c:4609:21: error: variable 'has_width' set but not used [-Werror=unused-but-set-variable]

Rather than hacking through a bunch of #ifdefs, where some used both
variables and others only used one, I changed the lone use of just
'width' to also use 'has_width'.

* lib/vasnprintf.c (VASNPRINTF): Avoid unused variable warning.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoc-ctype, regex, verify: port to gcc -std=c90 -pedantic
Paul Eggert [Thu, 30 May 2013 01:48:09 +0000 (18:48 -0700)]
c-ctype, regex, verify: port to gcc -std=c90 -pedantic

Avoid constructions that are rejected by gcc -std=c90 -pedantic.
This fixes a porting bug I recently reintroduced in regex, and
some other instances that I discovered while testing the fix.
* lib/c-ctype.h [__STRICT_ANSI__]: Avoid ({ ... }).
* lib/regcomp.c (utf8_sb_map) [__STRICT_ANSI__]: Avoid [0 ... N] = E.
* lib/regex_internal.h [!_LIBC && GNULIB_LOCK]: Do not use a macro
with an empty argument if this is a pedantic pre-C99 GCC.
* lib/verify.h: Do not use _Static_assert if this is a pedantic
pre-C11 GCC.

10 years agoregex: adapt to locking regime instead of depending on pthread
Paul Eggert [Wed, 29 May 2013 17:24:17 +0000 (10:24 -0700)]
regex: adapt to locking regime instead of depending on pthread

Instead of depending on pthread, adapt to whatever thread
modules are in use.  Problem reported by Ludovic Courtès in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-05/msg00082.html>
and by Mats Erik Andersson in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-05/msg00100.html>.
* lib/regex_internal.h (lock_define, lock_init, lock_fini):
Support either the 'lock' module, or the 'pthread' module, or
no module.
(lock_lock, lock_unlock): New macros.
* lib/regexec.c (regexec, re_search_stub): Use the new macros.
* modules/lock, modules/pthread (configure.ac): Add module indicator.
* modules/regex (Depends-on): Remove pthread.

10 years agogetgroups: document portability issues
Eric Blake [Wed, 22 May 2013 20:21:36 +0000 (14:21 -0600)]
getgroups: document portability issues

Because I actually managed to hit deadlock in libvirt's child
process due to glibc's mutex use in user database lookup, I
figured it is worth documenting the issue for others to be
aware of when writing a privileged multithreaded parent app
that spawns child processes owned by non-privileged ids.

* doc/glibc-functions/initgroups.texi (initgroups): Mention
multithread safety.
* doc/posix-functions/getpwuid.texi (getpwuid): Likewise.
* doc/posix-functions/getpwuid_r.texi (getpwuid_r): Likewise.
* doc/glibc-functions/getgrouplist.texi (getgrouplist): Mention
getugroups.
* doc/posix-functions/getgroups.texi (getgroups): Mention
multithread safety and mgetgroups.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agotest-lchown, test-chown: also skip test if lchown/chown fails with EPERM
Bernhard Voelker [Tue, 21 May 2013 22:53:50 +0000 (00:53 +0200)]
test-lchown, test-chown: also skip test if lchown/chown fails with EPERM

These tests abort on FAT file systems right after the test for
filtering out situation without ownership support; errno is EPERM
in such a case.

* tests/test-lchown.h (test_lchown): Add EPERM to the condition to
skip this test.
* tests/test-chown.h (test_chown): Likewise.

10 years agoregex: fix dfa race in multithreaded uses
Paul Eggert [Sun, 19 May 2013 21:26:05 +0000 (14:26 -0700)]
regex: fix dfa race in multithreaded uses

Problem reported by Ludovic Courtès in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-05/msg00058.html>.
* lib/regex_internal.h (lock_define, lock_init, lock_fini):
New macros.  All uses of __libc_lock_define, __libc_lock_init
changed to use the first two of these.
(__libc_lock_lock, __libc_lock_unlock): New macros, for
non-glibc platforms.
(struct re_dfa_t): Define the lock unconditionally.
* lib/regexec.c (regexec, re_search_stub): Remove some now-incorrect
'#ifdef _LIBC"s.
* modules/regex (Depends-on): Add pthread, if we use the
included regex.

* lib/regcomp.c: Do actions that are not needed for glibc,
but may be needed elsewhere.
(regfree, re_compile_internal): Destroy the lock.
(re_compile_internal): Check for lock-initialization failure.

10 years agomalloca: port to compilers that reject size-zero arrays
Paul Eggert [Sun, 19 May 2013 19:58:53 +0000 (12:58 -0700)]
malloca: port to compilers that reject size-zero arrays

This fixes a bug introduced in my previous patch.
* lib/malloca.c (struct preliminary_header): Use an int
rather than a character array of size int; that's simpler.
(struct header): Remove, replacing with ...
(union header): New type.  This avoids the need for declaring a
character array of size zero, which is not allowed on some platforms.
All uses changed.

10 years agoparse-datetime, tests: don't use "string" + int
Paul Eggert [Sun, 19 May 2013 00:20:41 +0000 (17:20 -0700)]
parse-datetime, tests: don't use "string" + int

Recent versions of 'clang' complain about C source code that
uses expressions of the form '"string literal" + integer',
I guess on the theory that it's confusing for readers who are
used to C++.  On those grounds I suppose it's OK to make this
minor style change.
* lib/parse-datetime.y (parse_datetime):
* tests/test-fchdir.c (main):
* tests/test-snprintf-posix.h (test_function):
* tests/test-snprintf.c (main):
* tests/test-vasnprintf-posix.c (test_function):
* tests/test-vasnprintf.c (test_function):
* tests/test-vsnprintf.c (main):
* tests/unistdio/test-ulc-asnprintf1.h (test_function):
Rewrite '"str" + E' to '&"str"[E]'.

10 years agoargmatch: port to C++
Alexandre Duret-Lutz [Fri, 17 May 2013 17:01:15 +0000 (19:01 +0200)]
argmatch: port to C++

* lib/argmatch.h [__cplusplus]: Add extern "C".

10 years agoargp: typo fix
Alexandre Duret-Lutz [Fri, 17 May 2013 17:01:14 +0000 (19:01 +0200)]
argp: typo fix

* lib/argp-help.c: Typo in comment.

10 years agoautoupdate
Karl Berry [Thu, 16 May 2013 16:25:59 +0000 (09:25 -0700)]
autoupdate

10 years agomanywarnings: update for GCC 4.8.0
Paul Eggert [Thu, 16 May 2013 06:21:29 +0000 (23:21 -0700)]
manywarnings: update for GCC 4.8.0

* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC):
Add -Waggressive-loop-optimizations, -Wreturn-local-addr, which
are new to GCC 4.8.  Remove -Wformat=2, -Wmissing-format-attribute,
-Wmissing-noreturn, as they are duplicates of other warnings.
Remove -Wunreachable-code, as it is removed in GCC 4.8 and
was documented to be flaky in earlier versions of GCC.

10 years agospawn-tests, sys_socket-tests, sys_wait-tests: port to clang
Paul Eggert [Wed, 15 May 2013 22:59:01 +0000 (15:59 -0700)]
spawn-tests, sys_socket-tests, sys_wait-tests: port to clang

* tests/test-spawn.c (main):
* tests/test-sys_socket.c (main):
* tests/test-sys_wait.c (main):
Don't have a switch value that isn't covered by a case.