]> Savannah Git Hosting - gnulib.git/log
gnulib.git
5 years agobitset: check memory allocation
Akim Demaille [Thu, 5 Sep 2019 09:36:39 +0000 (11:36 +0200)]
bitset: check memory allocation

Reported by 江 祖铭 (Zu-Ming Jiang).
With help from Paul Eggert.
https://lists.gnu.org/archive/html/bug-bison/2019-08/msg00016.html

* lib/bitset/table.c (tbitset_resize): When growing, use xrealloc
instead of realloc.
When shrinking, accept failures.
* lib/bitset/vector.c (vbitset_resize): Likewise.

5 years agoscratch_buffer: sync from glibc
Paul Eggert [Sun, 8 Sep 2019 05:13:08 +0000 (22:13 -0700)]
scratch_buffer: sync from glibc

* config/srclist.txt: Add the scratch_buffer source
code from glibc, since these should be in sync.
Autoupdate.

5 years agodoc: Update for glibc 2.30.
Bruno Haible [Sat, 7 Sep 2019 14:56:52 +0000 (16:56 +0200)]
doc: Update for glibc 2.30.

* doc/glibc-functions/gettid.texi: New file.
* doc/glibc-functions/pthread_cond_clockwait.texi: New file.
* doc/glibc-functions/pthread_mutex_clocklock.texi: New file.
* doc/glibc-functions/pthread_rwlock_clockrdlock.texi: New file.
* doc/glibc-functions/pthread_rwlock_clockwrlock.texi: New file.
* doc/glibc-functions/sem_clockwait.texi: New file.
* doc/glibc-functions/tgkill.texi: New file.
* doc/glibc-functions/twalk_r.texi: New file.
* doc/gnulib.texi: Include them.
(Glibc semaphore.h): New section.
* doc/pastposix-functions/h_errno.texi: Update.
* doc/posix-functions/*.texi: Likewise.

5 years agosymlink tests: Avoid test failure on Linux with Lustre file system.
Bruno Haible [Fri, 6 Sep 2019 22:17:51 +0000 (00:17 +0200)]
symlink tests: Avoid test failure on Linux with Lustre file system.

Reported by Thomas C Oppe <Thomas.C.Oppe@erdc.dren.mil>
at <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=37312>.

* tests/test-symlink.h (test_symlink): Accept errno value ENOENT.

5 years agogitsub.sh: Add support for shallow-cloning of subdirectories.
Bruno Haible [Sun, 1 Sep 2019 15:34:03 +0000 (17:34 +0200)]
gitsub.sh: Add support for shallow-cloning of subdirectories.

* top/gitsub.sh (func_usage): Document allowed git options with
'git pull'.
(func_pull): Accept GIT_OPTIONS argument.
(pull): Parse git options before complaining about too many arguments.
Pass the git options to func_pull.

5 years agolock: Fix cross-compilation guesses.
Bruno Haible [Thu, 29 Aug 2019 22:06:52 +0000 (00:06 +0200)]
lock: Fix cross-compilation guesses.

* m4/pthread_rwlock_rdlock.m4 (gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER):
Require AC_CANONICAL_HOST. When cross-compiling, guess no on most
platforms.

5 years agoisfinite, isinf, isnan, signbit: Fix error in C++ mode on mingw.
Bruno Haible [Wed, 28 Aug 2019 16:03:43 +0000 (18:03 +0200)]
isfinite, isinf, isnan, signbit: Fix error in C++ mode on mingw.

Reported by Martin Storsjö <martin@martin.st> in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-08/msg00075.html>.

* lib/math.in.h (_GL_MATH_CXX_REAL_FLOATING_DECL_2): Add more arguments.
(isfinite, isinf, isnan, signbit): On platforms that use C++ include
files from GCC 6 or newer, use an override through '#define', because
the inline definitions in the platform's <cmath> cannot be overridden
in another way.

5 years agoisfinite, isinf, isnan, signbit: Fix error in C++ mode on mingw.
Bruno Haible [Wed, 28 Aug 2019 08:34:40 +0000 (10:34 +0200)]
isfinite, isinf, isnan, signbit: Fix error in C++ mode on mingw.

Reported by Martin Storsjö <martin@martin.st> in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-08/msg00075.html>.

* lib/math.in.h (_GL_MATH_CXX_REAL_FLOATING_DECL_2): Add more arguments.
(isfinite, isinf, isnan, signbit): On mingw, use an override through
'#define', because the inline definitions in the platform's <cmath>
cannot be overridden in another way.

5 years agoRevert macOS INT_MULTIPLY_WRAPV patch
Paul Eggert [Wed, 28 Aug 2019 01:04:03 +0000 (18:04 -0700)]
Revert macOS INT_MULTIPLY_WRAPV patch

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2019-08/msg00076.html
* lib/intprops.h (_GL_HAS___builtin_mul_overflow): Remove.
(_GL_HAS_BUILTIN_MUL_OVERFLOW):
Go back to working around the Clang bug on macOS.

5 years agolibtool-next-version: Fix error output.
Bruno Haible [Sun, 25 Aug 2019 00:53:02 +0000 (02:53 +0200)]
libtool-next-version: Fix error output.

* build-aux/libtool-next-version (func_fatal_error): Fix the program
name.

5 years agoautoupdate
Karl Berry [Tue, 27 Aug 2019 13:28:41 +0000 (06:28 -0700)]
autoupdate

5 years agoSpeed up INT_MULTIPLY_WRAPV on macOS
Paul Eggert [Tue, 27 Aug 2019 11:23:44 +0000 (04:23 -0700)]
Speed up INT_MULTIPLY_WRAPV on macOS

Assume that __builtin_mul_overflow works OK with Clang on macOS.
Mattias Engdegård says it’s safe to assume the relevant library
is always available there.
* lib/intprops.h (_GL_HAS___builtin_mul_overflow):
New temporary internal macro.
(_GL_HAS_BUILTIN_MUL_OVERFLOW):
No need to work around the Clang bug on macOS.

5 years agointprops.h, verify.h: port better to clang
Paul Eggert [Mon, 26 Aug 2019 02:29:15 +0000 (19:29 -0700)]
intprops.h, verify.h: port better to clang

Improve code generated by INT_ADD_WRAPV and INT_SUBTRACT_WRAPV
with Clang.  Problem reported privately by Mattias Engdegård.
Also, insulate intprops.h and verify.h better against each other’s
definitions of __has_builtin on non-Clang hosts.
* lib/intprops.h (__has_builtin): Define a temporary substitute
if __has_builtin is not already defined.
(_GL_HAS___builtin_add_overflow, _GL_TEMPDEF___has_builtin):
New temporary internal macros.
(_GL_HAS_BUILTIN_ADD_OVERFLOW, _GL_HAS_BUILTIN_MUL_OVERFLOW):
Now two separate macros, replacing the old
_GL_HAS_BUILTIN_OVERFLOW, since we no longer assume that
__builtin_mul_overflow is like the rest.  All uses changed.
(INT_ADD_WRAPV, INT_SUBTRACT_WRAPV, INT_MULTIPLY_WRAPV):
Adjust to above changes.
(_GL_INT_OP_WRAPV): Remove ‘builtin’ arg, since it’s no
longer relevant.  All uses changed.
* lib/verify.h (__has_builtin): Treat like intprops.h,
so that the two .h files do not collide with each other.
(_GL_HAS___builtin_unreachable, _GL_HAS___builtin_trap)
(_GL_TEMPDEF___has_builtin): New temporary internal macros.

5 years agointprops: say why not Clang __builtin_add_overflow
Paul Eggert [Sun, 25 Aug 2019 00:17:39 +0000 (17:17 -0700)]
intprops: say why not Clang __builtin_add_overflow

* lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW):
Mention Clang in comment, responding to a query from
Mattias Engdegård.

5 years agodoc: Document most of the files outside of modules.
Bruno Haible [Sat, 24 Aug 2019 20:05:28 +0000 (22:05 +0200)]
doc: Document most of the files outside of modules.

* doc/gnulib.texi (Build Infrastructure Files,
Release Management Files): New chapters.

5 years agobootstrap: Keep in sync with the 'gettext' module.
Bruno Haible [Sat, 24 Aug 2019 16:29:14 +0000 (18:29 +0200)]
bootstrap: Keep in sync with the 'gettext' module.

Reported by Assaf Gordon in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-08/msg00045.html>.

* build-aux/po/Makefile.in.in: Update to gettext 0.20.
* build-aux/po/remove-potcdate.sin: Likewise.

5 years agocrypto/gc-sha512: Add tests.
Bruno Haible [Sat, 24 Aug 2019 15:37:10 +0000 (17:37 +0200)]
crypto/gc-sha512: Add tests.

* tests/test-gc-sha512.c: New file, based on tests/test-gc-sha1.c.
* modules/crypto/gc-sha512-tests: New file.

5 years agocrypto/gc-sha256: Add tests.
Bruno Haible [Sat, 24 Aug 2019 15:36:28 +0000 (17:36 +0200)]
crypto/gc-sha256: Add tests.

* tests/test-gc-sha256.c: New file, based on tests/test-gc-sha1.c.
* modules/crypto/gc-sha256-tests: New file.

5 years agocrypto/gc-sha256, crypto/gc-sha512: New modules.
Bruno Haible [Sat, 24 Aug 2019 15:34:29 +0000 (17:34 +0200)]
crypto/gc-sha256, crypto/gc-sha512: New modules.

* lib/gc.h (gc_sha256, gc_sha512): New declarations.
* lib/gc-gnulib.c: Include sha256.h, sha512.h.
(MAX_DIGEST_SIZE): Set to 64.
(_gc_hash_ctx, gc_hash_open, gc_hash_digest_length, gc_hash_write,
gc_hash_read, gc_hash_buffer): Add support for sha256 and sha512.
(gc_sha256, gc_sha512): New functions.
* lib/gc-libgcrypt.c (gc_sha256, gc_sha512): New functions.
* modules/crypto/gc-sha256: New file, based on modules/crypto/gc-sha1.
* modules/crypto/gc-sha512: New file, based on modules/crypto/gc-sha1.

5 years agocrypto/gc-sha1 tests: Improve output when the test fails.
Bruno Haible [Sat, 24 Aug 2019 15:28:48 +0000 (17:28 +0200)]
crypto/gc-sha1 tests: Improve output when the test fails.

* tests/test-gc-sha1.c (main): In case of mismatch, print the entire
output.

5 years agocrypto/gc-sm3: Fix compilation error with --with-libgcrypt.
Bruno Haible [Sat, 24 Aug 2019 14:16:33 +0000 (16:16 +0200)]
crypto/gc-sm3: Fix compilation error with --with-libgcrypt.

* m4/gc-sm3.m4 (gl_GC_SM3): Test whether libgcrypt supports SM3. Define
LIBGCRYPT_HAS_MD_SM3.
* lib/gc-libgcrypt.c: Include sm3.h.
(_gc_hash_ctx, gc_hash_open, gc_hash_hmac_setkey, gc_hash_write,
gc_hash_read, gc_hash_close, gc_hash_buffer, gc_sm3): Use the gnulib
implementation if libgcrypt does not support SM3.

5 years agocrypto/gc-md2: Optimize and clarify code.
Bruno Haible [Sat, 24 Aug 2019 14:15:02 +0000 (16:15 +0200)]
crypto/gc-md2: Optimize and clarify code.

* lib/gc-gnulib.c (gc_hash_open): Comment out md2_init_ctx invocation.
* lib/gc-libgcrypt.c (gc_hash_open): Clarify why md2_init_ctx invocation
is not needed.

5 years agocrypto/gc-md2: Add comment.
Bruno Haible [Sat, 24 Aug 2019 13:01:44 +0000 (15:01 +0200)]
crypto/gc-md2: Add comment.

* lib/gc-libgcrypt.c: Add comment.

5 years agocrypto/gc-{md[24],rijndael} tests: Fix link error with --with-libgcrypt.
Bruno Haible [Sat, 24 Aug 2019 12:28:15 +0000 (14:28 +0200)]
crypto/gc-{md[24],rijndael} tests: Fix link error with --with-libgcrypt.

* modules/crypto/gc-md2-tests (test_gc_md2_LDADD): New variable.
* modules/crypto/gc-md4-tests (test_gc_md4_LDADD): New variable.
* modules/crypto/gc-rijndael-tests (test_gc_rijndael_LDADD): New
variable.

5 years agocrypto/gc: Fix link error with --with-libgcrypt.
Bruno Haible [Sat, 24 Aug 2019 12:00:57 +0000 (14:00 +0200)]
crypto/gc: Fix link error with --with-libgcrypt.

* m4/gc.m4 (gl_GC): Set LIB_CRYPTO to the value found by the
AC_LIB_HAVE_LINKFLAGS invocation.

5 years agocrypto/gc: Access the module indicators correctly.
Bruno Haible [Sat, 24 Aug 2019 11:32:44 +0000 (13:32 +0200)]
crypto/gc: Access the module indicators correctly.

* lib/gc-gnulib.c: Use '#if GNULIB_GC_*', not '#ifdef GNULIB_GC_*'.
* lib/gc-libgcrypt.c: Likewise.

5 years agogc: Fix configuration with --with-libgcrypt.
Bruno Haible [Sat, 24 Aug 2019 09:07:23 +0000 (11:07 +0200)]
gc: Fix configuration with --with-libgcrypt.

* m4/libgcrypt.m4: New file, copied from libgcrypt/src/libgcrypt.m4.
* modules/crypto/gc (Files): Add it.
* m4/gc.m4 (gl_GC): Assume AM_PATH_LIBGCRYPT is defined.

5 years agoRemove unused file.
Bruno Haible [Sat, 24 Aug 2019 07:24:17 +0000 (09:24 +0200)]
Remove unused file.

* m4/stat-macros.m4: Remove file.

5 years agoautoupdate
Paul Eggert [Wed, 21 Aug 2019 18:37:09 +0000 (11:37 -0700)]
autoupdate

5 years agoNew strip-trailing-space option for srclist-update
Paul Eggert [Wed, 21 Aug 2019 18:30:10 +0000 (11:30 -0700)]
New strip-trailing-space option for srclist-update

* config/srclist-update (fixfile): Support new option.
* config/srclist.txt (texinfo.tex, maintain.texi, standards.texi):
Use it.

5 years agoaccept4: Fix typo in previous commit
Eric Blake [Tue, 20 Aug 2019 19:33:40 +0000 (14:33 -0500)]
accept4: Fix typo in previous commit

* lib/accept4.c (accept4): Use correct preprocessor condition.

Signed-off-by: Eric Blake <eblake@redhat.com>
5 years agoaccept4: Support SOCK_NONBLOCK, if defined
Eric Blake [Tue, 20 Aug 2019 16:34:34 +0000 (11:34 -0500)]
accept4: Support SOCK_NONBLOCK, if defined

Ideally, we would improve our replacement <sys/socket.h> to define a
replacement SOCK_NONBLOCK on all platforms, and teach socket() to
honor it as well; but that's a bigger task.  In the meantime, if the
platform already has SOCK_NONBLOCK, we should honor it when doing a
fallback.

* lib/accept4.c (accept4): If SOCK_NONBLOCK is defined, honor it.

5 years agoaccept4: Fix compilation when native accept4() exists.
Eric Blake [Tue, 20 Aug 2019 16:26:17 +0000 (11:26 -0500)]
accept4: Fix compilation when native accept4() exists.

Reported by Richard W.M. Jones <rjones@redhat.com> in
https://lists.gnu.org/archive/html/bug-gnulib/2019-08/msg00029.html
* lib/accept4.c (accept4): Match witness symbol to m4 file update.

5 years agoautoupdate
Karl Berry [Mon, 19 Aug 2019 15:33:08 +0000 (08:33 -0700)]
autoupdate

5 years agoDefeat -flto GCC optimization in math autoconf tests.
Bruno Haible [Sun, 18 Aug 2019 14:12:29 +0000 (16:12 +0200)]
Defeat -flto GCC optimization in math autoconf tests.

Reported by Tomasz Kłoczko <kloczko.tomasz@gmail.com>
at <https://savannah.gnu.org/bugs/?56109>.

* m4/mathfunc.m4 (gl_MATHFUNC): Mark function pointer as 'volatile'.
* m4/acosl.m4 (gl_FUNC_ACOSL): Likewise.
* m4/asinl.m4 (gl_FUNC_ASINL): Likewise.
* m4/atanl.m4 (gl_FUNC_ATANL): Likewise.
* m4/cosl.m4 (gl_FUNC_COSL): Likewise.
* m4/exp2.m4 (gl_FUNC_EXP2): Likewise.
* m4/expl.m4 (gl_FUNC_EXPL): Likewise.
* m4/expm1.m4 (gl_FUNC_EXPM1): Likewise.
* m4/expm1l.m4 (gl_FUNC_EXPM1L): Likewise.
* m4/sinl.m4 (gl_FUNC_SINL): Likewise.
* m4/sqrtl.m4 (gl_FUNC_SQRTL): Likewise.
* m4/tanl.m4 (gl_FUNC_TANL): Likewise.

5 years agowindows-spin: Implement declared functions.
Bruno Haible [Fri, 16 Aug 2019 21:36:59 +0000 (23:36 +0200)]
windows-spin: Implement declared functions.

Reported by Gisle Vanem <gisle.vanem@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-08/msg00024.html>.

* lib/windows-spin.c (glwthread_spin_trylock): Fix typo in function
name.

5 years agointprops: port to Oracle Developer Studio 12.6
Paul Eggert [Sat, 17 Aug 2019 10:13:42 +0000 (03:13 -0700)]
intprops: port to Oracle Developer Studio 12.6

* lib/intprops.h (_GL_INT_OP_WRAPV): Fix recently-introduced
typos that were in a section not compiled by GCC.

5 years agointprops: support uchar, ushort _WRAPV dests
Paul Eggert [Thu, 15 Aug 2019 05:24:49 +0000 (22:24 -0700)]
intprops: support uchar, ushort _WRAPV dests

* lib/intprops.h (_GL_INT_OP_WRAPV_SMALLISH): New macro, defined
when __builtin_add_overflow etc. and _Generic are not used.
(_GL_INT_OP_WRAPV): Use it to support destinations that
are unsigned char or unsigned short, even in compilers
that lack __typeof__ and are not C11-compatible.

5 years agointprops: pacify picky GCC
Paul Eggert [Thu, 15 Aug 2019 01:05:57 +0000 (18:05 -0700)]
intprops: pacify picky GCC

* lib/intprops.h (_GL_BUILTIN_MUL_OVERFLOW):
Pacify GCC’s complaints about ignoring __builtin_mul_overflow’s
possibly-incorrect result.
(_GL_INT_MULTIPLY_RANGE_OVERFLOW): Pacify GCC’s complaints
about (A) used as a boolean, when A is an expression like 3 * 4.

5 years agointprops: support unsigned *_WRAPV results
Paul Eggert [Thu, 15 Aug 2019 00:43:46 +0000 (17:43 -0700)]
intprops: support unsigned *_WRAPV results

Add support for unsigned, unsigned long, and unsigned long long
results to INT_ADD_WRAPV, INT_SUBTRACT_WRAPV, and
INT_MULTIPLY_WRAPV.  Also, work around GCC bug 91450, and fix a
bug with unsigned inputs reported by Eli Zaretskii in:
https://lists.gnu.org/r/bug-gnulib/2019-08/msg00012.html
* config/srclist.txt: Break the glibc connection for intprops.h
temporarily, while more testing is done in Gnulib-using apps.
* lib/intprops.h (INT_ADD_WRAPV, INT_SUBTRACT_WRAPV)
(INT_MULTIPLY_WRAPV, _GL_INT_OP_WRAPV, _GL_INT_OP_WRAPV_LONGISH):
Support unsigned results no narrower than unsigned int.  Report
overflow correctly if some arguments are unsigned.
(_GL_BUILTIN_MUL_OVERFLOW): New macro, to work around GCC bug 91450.
(_GL_INT_OP_CALC): Simplify now that the OVERFLOW argument does
the right thing with narrow args.
(_GL_INT_OP_CALC1): Remove.  All callers removed.
(_GL_INT_ADD_RANGE_OVERFLOW, _GL_INT_SUBTRACT_RANGE_OVERFLOW)
(_GL_INT_MULTIPLY_RANGE_OVERFLOW): New macros.
* tests/test-intprops.c: Check for bugs and test new behavior.

5 years agoget_progname_of: New module.
Bruno Haible [Wed, 14 Aug 2019 09:21:55 +0000 (11:21 +0200)]
get_progname_of: New module.

* lib/get_progname_of.h: New file.
* lib/get_progname_of.c: New file, based on lib/getprogname.c.
* lib/getprogname.c (getprogname): Tweak coding style.
* lib/vma-iter.c (vma_iterate_bsd): Update comment.
* modules/get_progname_of: New file.

5 years agoget_ppid_of: New module.
Bruno Haible [Wed, 14 Aug 2019 09:21:37 +0000 (11:21 +0200)]
get_ppid_of: New module.

* lib/get_ppid_of.h: New file.
* lib/get_ppid_of.c: New file.
* modules/get_ppid_of: New file.

5 years agolibtextstyle-optional tests: Support the NO_COLOR environment variable.
Bruno Haible [Wed, 14 Aug 2019 00:48:59 +0000 (02:48 +0200)]
libtextstyle-optional tests: Support the NO_COLOR environment variable.

* tests/test-libtextstyle.c (main): Do not emit styling when the
environment variable NO_COLOR is set.

5 years agoverify: improve diagnostic quality in recent GCC
Paul Eggert [Mon, 12 Aug 2019 21:57:08 +0000 (14:57 -0700)]
verify: improve diagnostic quality in recent GCC

If ‘verify’ fails in a deeply-nested macro, GCC does not output a
useful line number containing the top-level caller of the macro.
So, bring back the older way of issuing a diagnostic containing
the top-level call’s arg, so that it is easier to diagnose
‘verify’ failures with recent GCC.
* lib/verify.h (_GL_VERIFY_TRUE, _GL_VERIFY_TYPE):
Bring back DIAGNOSTIC arg.  All callers changed.
(verify): Just use _GL_VERIFY.

5 years agolocalcharset: Add more aliases for OS/2.
Bruno Haible [Sun, 11 Aug 2019 16:52:28 +0000 (18:52 +0200)]
localcharset: Add more aliases for OS/2.

Based on patch by KO Myung-Hun <komh78@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnu-libiconv/2019-08/msg00004.html>.

* lib/localcharset.c (alias_table) [OS2]: Add more aliases.

5 years agoconfigmake: Update advice on usage.
Eric Blake [Sat, 10 Aug 2019 21:20:47 +0000 (16:20 -0500)]
configmake: Update advice on usage.

* modules/configmake (Include): No longer necessary to include
last, since configmake.h itself worries about collision avoidance.

5 years agoparse-datetime: fix 'T' military timezone handling
Assaf Gordon [Sat, 10 Aug 2019 19:17:49 +0000 (13:17 -0600)]
parse-datetime: fix 'T' military timezone handling

* lib/parse-datetime.y (zone):
follow-up to the previous commit: the 'T' case is handled outside the
conversion table (used as either military timezone UTC-7 or ISO8601
separator). Change it from "HOUR(7)" to "-HOUR(7)" to match other
timezone letters.

5 years agoparse-datetime: fix military timezone letters
Paul Eggert [Fri, 9 Aug 2019 20:47:41 +0000 (13:47 -0700)]
parse-datetime: fix military timezone letters

Problem and trivial fix reported by Neil Hoggarth in:
https://lists.gnu.org/r/bug-gnulib/2019-08/msg00005.html
* lib/parse-datetime.y (military_table):
Do it the right way, not the RFC 822 way.

5 years agoconfigmake: Avoid namespace pollution issue on mingw.
Eric Blake [Thu, 8 Aug 2019 03:03:31 +0000 (22:03 -0500)]
configmake: Avoid namespace pollution issue on mingw.

Mingw includes a header that declares an enum typedef named DATADIR,
pulled in when including <winsock2.h>; compilation fails if DATADIR
has already been defined as a macro expanding to a string prior to
that inclusion.  Although the configmake module documents that it
should generally be included only after system headers, it is just as
easy to make configmake.h robust to this particular issue by including
the system header first if it exists.

* modules/configmake (Makefile.am): If the project uses
<winsock2.h>, include that header before defining DATADIR.
Reported by libvirt: https://lists.gnu.org/archive/html/bug-gnulib/2019-07/msg00089.html

5 years agombrtowc tests: Fix regression on mingw (regression from 2018-02-24).
Bruno Haible [Mon, 29 Jul 2019 01:03:17 +0000 (03:03 +0200)]
mbrtowc tests: Fix regression on mingw (regression from 2018-02-24).

* tests/test-mbrtowc.c (main): Fix expected value of wc.

5 years agopthread-h: Fix definitions of types and macros on mingw.
Bruno Haible [Thu, 25 Jul 2019 01:19:53 +0000 (03:19 +0200)]
pthread-h: Fix definitions of types and macros on mingw.

* lib/pthread.in.h (pthread_t, pthread_attr_t, PTHREAD_CREATE_JOINABLE,
PTHREAD_CREATE_DETACHED): Define also when module 'pthread-thread' is
not in use.
(pthread_once_t, PTHREAD_ONCE_INIT): Define also when module
'pthread-once' is not in use.
(pthread_mutex_t, pthread_mutexattr_t, PTHREAD_MUTEX_INITIALIZER,
PTHREAD_MUTEX_DEFAULT, PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_ERRORCHECK,
PTHREAD_MUTEX_RECURSIVE): Define also when module 'pthread-mutex' is not
in use.
(pthread_rwlock_t, pthread_rwlockattr_t, PTHREAD_RWLOCK_INITIALIZER):
Define also when module 'pthread-rwlock' is not in use.
(pthread_cond_t, pthread_condattr_t, PTHREAD_COND_INITIALIZER): Define
also when module 'pthread-cond' is not in use.
(pthread_key_t, PTHREAD_DESTRUCTOR_ITERATIONS): Define also when module
'pthread-tss' is not in use.
(pthread_spinlock_t): Define also when module 'pthread-spin' is not in
use.

5 years agoautoupdate
Karl Berry [Wed, 24 Jul 2019 14:27:58 +0000 (07:27 -0700)]
autoupdate

5 years agocrypto/gc: Cope with libgcrypt without SM3.
Simon Josefsson [Wed, 24 Jul 2019 08:01:50 +0000 (10:01 +0200)]
crypto/gc: Cope with libgcrypt without SM3.

* lib/gc-libgcrypt.c (gc_hash_open): Guard SM3 usage.

5 years agobackupfile: fix resource leak on memory failure
Paul Eggert [Tue, 23 Jul 2019 19:25:01 +0000 (12:25 -0700)]
backupfile: fix resource leak on memory failure

Problem found by Coverity (CID 1484214).
* lib/backupfile.c (backupfile_internal): Don’t leak dirp.

5 years agoAvoid missing-declarations warning in various tests.
Bruno Haible [Mon, 22 Jul 2019 10:32:39 +0000 (12:32 +0200)]
Avoid missing-declarations warning in various tests.

* tests/test-argp.c (fail, test1, test2, test_file, test3, test4, test5,
test6, test_optional, test7, test8, test9, test10, test11, test12,
test13, test14, test15, test_fun): Declare static.
* tests/test-cnd.c (test_cnd_wait): Likewise.
* tests/test-cond.c (test_cond): Likewise.

5 years agopthread tests: Avoid missing-declarations warning.
Bernhard Voelker [Mon, 22 Jul 2019 10:28:26 +0000 (12:28 +0200)]
pthread tests: Avoid missing-declarations warning.

* tests/test-pthread-cond.c (test_pthread_cond_wait): Declare static.

5 years agoparse-datetime: Avoid warnings from bison versions >= 3.3.
Bruno Haible [Fri, 19 Jul 2019 22:51:26 +0000 (00:51 +0200)]
parse-datetime: Avoid warnings from bison versions >= 3.3.

Reported by Bernhard Voelker <mail@bernhard-voelker.de>.

* modules/parse-datetime (Makefile.am): Don't pass option '-y' to bison.

5 years agoparse-datetime: Require Bison 2.4 or newer.
Bruno Haible [Fri, 19 Jul 2019 03:00:10 +0000 (05:00 +0200)]
parse-datetime: Require Bison 2.4 or newer.

* m4/parse-datetime.m4 (gl_PARSE_DATETIME): Set PARSE_DATETIME_BISON.
Code taken from gettext's intl.m4.
* modules/parse-datetime (Makefile.am): Use PARSE_DATETIME_BISON instead
of YACC.

5 years agoareadlink-with-size, xgethostname, xgetdomainname: Fix GCC warning.
Bruno Haible [Fri, 19 Jul 2019 03:21:11 +0000 (05:21 +0200)]
areadlink-with-size, xgethostname, xgetdomainname: Fix GCC warning.

* lib/areadlink-with-size.c: Include <string.h>.
* lib/areadlinkat-with-size.c: Likewise.
* lib/xgethostname.c: Likewise.
* lib/xgetdomainname.c: Likewise.

5 years agoparse-datetime: avoid "%pure-parser" deprecation warning from Bison 3.4
Bernhard Voelker [Thu, 18 Jul 2019 23:17:25 +0000 (01:17 +0200)]
parse-datetime: avoid "%pure-parser" deprecation warning from Bison 3.4

* lib/parse-datetime.y: Use "%define api.pure" rather than obsolescent
"%pure-parser".  The former is available since Bison 2.3b (2008, [1]),
while the latter is marked as obsolete since version 3.4 (May 2019, [2]):

  ./lib/parse-datetime.y:568.1-12: warning: deprecated directive, \
    use '%define api.pure' [-Wdeprecated]
  568 | %pure-parser
      | ^~~~~~~~~~~~

[1] https://git.sv.gnu.org/cgit/bison.git/commit/?id=d9df47b656fd
[2] https://git.sv.gnu.org/cgit/bison.git/commit/?id=de5207244b5c

5 years agoupdate-copyright: Make it work again (regression from 2019-06-15).
Bruno Haible [Tue, 16 Jul 2019 08:02:30 +0000 (10:02 +0200)]
update-copyright: Make it work again (regression from 2019-06-15).

Reported by Brian C. Lane <bcl@redhat.com>.

* build-aux/update-copyright: Add back the -0777, -p, -i options.

5 years agodoc: Update info about <pthread.h>.
Bruno Haible [Mon, 15 Jul 2019 01:10:38 +0000 (03:10 +0200)]
doc: Update info about <pthread.h>.

* doc/posix-headers/pthread.texi: Mention the module 'pthread-h' instead
of 'pthread'.

5 years agopthread_sigmask tests: Use new multithread modules.
Bruno Haible [Mon, 15 Jul 2019 00:41:24 +0000 (02:41 +0200)]
pthread_sigmask tests: Use new multithread modules.

* tests/test-pthread_sigmask2.c: Include <pthread.h> instead of
glthread/thread.h.
(main_thread, killer_thread): Change type to pthread_t.
(main): Update accordingly.
* modules/pthread_sigmask-tests (Depends-on): Add pthread-thread. Remove
thread.

5 years agopthread-tss: Add tests.
Bruno Haible [Mon, 15 Jul 2019 00:41:21 +0000 (02:41 +0200)]
pthread-tss: Add tests.

* tests/test-pthread-tss.c: New file, based on tests/test-tls.c and
tests/test-tss.c.
* modules/pthread-tss-tests: New file.

5 years agopthread-cond: Add tests.
Bruno Haible [Mon, 15 Jul 2019 00:41:18 +0000 (02:41 +0200)]
pthread-cond: Add tests.

* tests/test-pthread-cond.c: New file, based on tests/test-cond.c and
tests/test-cnd.c.
* modules/pthread-cond-tests: New file.

5 years agopthread-rwlock: Add tests.
Bruno Haible [Mon, 15 Jul 2019 00:41:14 +0000 (02:41 +0200)]
pthread-rwlock: Add tests.

* tests/test-pthread-rwlock.c: New file, based on tests/test-lock.c.
* modules/pthread-rwlock-tests: New file.

5 years agopthread-mutex: Add tests.
Bruno Haible [Mon, 15 Jul 2019 00:41:12 +0000 (02:41 +0200)]
pthread-mutex: Add tests.

* tests/test-pthread-mutex.c: New file, based on tests/test-lock.c and
tests/test-mtx.c.
* modules/pthread-mutex-tests: New file.

5 years agopthread-once: Add tests.
Bruno Haible [Mon, 15 Jul 2019 00:41:09 +0000 (02:41 +0200)]
pthread-once: Add tests.

* tests/test-pthread-once1.c: New file, based on tests/test-once.c and
tests/test-call_once.c.
* tests/test-pthread-once2.c: New file, based on tests/test-lock.c and
tests/test-mtx.c.
* modules/pthread-once-tests: New file.

5 years agopthread-thread: Add tests.
Bruno Haible [Mon, 15 Jul 2019 00:41:07 +0000 (02:41 +0200)]
pthread-thread: Add tests.

* tests/test-pthread-thread.c: New file, based on
tests/test-thread_create.c and tests/test-thrd_create.c.
* modules/pthread-thread-tests: New file.

5 years agopthread: Turn into a convenience module.
Bruno Haible [Mon, 15 Jul 2019 00:41:05 +0000 (02:41 +0200)]
pthread: Turn into a convenience module.

* lib/pthread.in.h: Remove declarations for extern inline functions.
* lib/pthread.c: Remove file.
* modules/pthread (Files): Remove it.
(Depends-on): Add pthread-thread, pthread-once, pthread-mutex,
pthread-rwlock, pthread-cond, pthread-tss, pthread-spin.
(configure.ac): Don't compile lib/pthread.c. Don't set GNULIB_PTHREAD.
* m4/pthread_h.m4 (gl_PTHREAD_H_DEFAULTS): Don't initialize
GNULIB_PTHREAD.
* modules/pthread-h (Makefile.am): Don't substitute GNULIB_PTHREAD.

5 years agopthread-spin: New module.
Bruno Haible [Mon, 15 Jul 2019 00:41:02 +0000 (02:41 +0200)]
pthread-spin: New module.

* lib/pthread.in.h (pthread_spin_init, pthread_spin_destroy,
pthread_spin_lock, pthread_spin_trylock, pthread_spin_unlock): Remove
inline definitions.
* lib/pthread-spin.c: New file.
* m4/pthread-spin.m4: New file.
* modules/pthread-spin: New file.
* doc/posix-functions/pthread_spin_init.texi: Mention the new module.
* doc/posix-functions/pthread_spin_lock.texi: Likewise.
* doc/posix-functions/pthread_spin_trylock.texi: Likewise.
* doc/posix-functions/pthread_spin_unlock.texi: Likewise.
* doc/posix-functions/pthread_spin_destroy.texi: Likewise.

5 years agopthread-tss: New module.
Bruno Haible [Mon, 15 Jul 2019 00:41:00 +0000 (02:41 +0200)]
pthread-tss: New module.

* lib/pthread-tss.c: New file.
* m4/pthread-tss.m4: New file.
* modules/pthread-tss: New file.
* doc/posix-functions/pthread_key_create.texi: Mention the new module.
* doc/posix-functions/pthread_setspecific.texi: Likewise.
* doc/posix-functions/pthread_getspecific.texi: Likewise.
* doc/posix-functions/pthread_key_delete.texi: Likewise.

5 years agopthread-cond: New module.
Bruno Haible [Mon, 15 Jul 2019 00:40:57 +0000 (02:40 +0200)]
pthread-cond: New module.

* lib/pthread.in.h (pthread_cond_destroy, pthread_cond_init,
pthread_cond_signal, pthread_cond_wait): Remove inline definitions.
* lib/pthread-cond.c: New file.
* m4/pthread-cond.m4: New file.
* modules/pthread-cond: New file.
* doc/posix-functions/pthread_cond_init.texi: Mention the new module.
* doc/posix-functions/pthread_condattr_init.texi: Likewise.
* doc/posix-functions/pthread_condattr_destroy.texi: Likewise.
* doc/posix-functions/pthread_cond_wait.texi: Likewise.
* doc/posix-functions/pthread_cond_timedwait.texi: Likewise.
* doc/posix-functions/pthread_cond_signal.texi: Likewise.
* doc/posix-functions/pthread_cond_broadcast.texi: Likewise.
* doc/posix-functions/pthread_cond_destroy.texi: Likewise.

5 years agopthread-rwlock: New module.
Bruno Haible [Mon, 15 Jul 2019 00:37:47 +0000 (02:37 +0200)]
pthread-rwlock: New module.

* lib/pthread-rwlock.c: New file, based on lib/glthread/lock.c.
* m4/pthread-rwlock.m4: New file.
* modules/pthread-rwlock: New file.
* doc/posix-functions/pthread_rwlock_init.texi: Mention the new module
and the Android problem.
* doc/posix-functions/pthread_rwlockattr_init.texi: Likewise.
* doc/posix-functions/pthread_rwlockattr_destroy.texi: Likewise.
* doc/posix-functions/pthread_rwlock_rdlock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_wrlock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_tryrdlock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_trywrlock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_timedrdlock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_timedwrlock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_unlock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_destroy.texi: Likewise.

5 years agopthread-mutex: New module.
Bruno Haible [Mon, 15 Jul 2019 00:37:44 +0000 (02:37 +0200)]
pthread-mutex: New module.

* lib/pthread.in.h (pthread_mutexattr_destroy, pthread_mutexattr_init,
pthread_mutexattr_settype, pthread_mutex_destroy, pthread_mutex_init,
pthread_mutex_lock, pthread_mutex_trylock, pthread_mutex_timedlock,
pthread_mutex_unlock): Remove inline definitions.
* lib/pthread-mutex.c: New file.
* m4/pthread-mutex.m4: New file.
* modules/pthread-mutex: New file.
* doc/posix-functions/pthread_mutex_init.texi: Mention the new module.
* doc/posix-functions/pthread_mutexattr_init.texi: Likewise.
* doc/posix-functions/pthread_mutexattr_gettype.texi: Likewise.
* doc/posix-functions/pthread_mutexattr_settype.texi: Likewise.
* doc/posix-functions/pthread_mutexattr_getrobust.texi: Likewise.
* doc/posix-functions/pthread_mutexattr_setrobust.texi: Likewise.
* doc/posix-functions/pthread_mutexattr_destroy.texi: Likewise.
* doc/posix-functions/pthread_mutex_lock.texi: Likewise.
* doc/posix-functions/pthread_mutex_trylock.texi: Likewise.
* doc/posix-functions/pthread_mutex_timedlock.texi: Likewise.
* doc/posix-functions/pthread_mutex_unlock.texi: Likewise.
* doc/posix-functions/pthread_mutex_destroy.texi: Likewise.

5 years agopthread-once: New module.
Bruno Haible [Mon, 15 Jul 2019 00:37:41 +0000 (02:37 +0200)]
pthread-once: New module.

* lib/pthread-once.c: New file.
* m4/pthread-once.m4: New file.
* modules/pthread-once: New file.
* doc/posix-functions/pthread_once.texi: Mention the new module.

5 years agopthread-thread: New module.
Bruno Haible [Mon, 15 Jul 2019 00:37:38 +0000 (02:37 +0200)]
pthread-thread: New module.

* lib/pthread.in.h (pthread_create, pthread_exit, pthread_join): Remove
inline definitions.
* lib/pthread-thread.c: New file.
* m4/pthread-thread.m4: New file.
* modules/pthread-thread: New file.
* doc/posix-functions/pthread_create.texi: Mention the new module.
* doc/posix-functions/pthread_attr_init.texi: Likewise.
* doc/posix-functions/pthread_attr_getdetachstate.texi: Likewise.
* doc/posix-functions/pthread_attr_setdetachstate.texi: Likewise.
* doc/posix-functions/pthread_attr_destroy.texi: Likewise.
* doc/posix-functions/pthread_self.texi: Likewise.
* doc/posix-functions/pthread_equal.texi: Likewise.
* doc/posix-functions/pthread_detach.texi: Likewise.
* doc/posix-functions/pthread_join.texi: Likewise.
* doc/posix-functions/pthread_exit.texi: Likewise.

5 years agopthread-h: Prepare for adding new modules.
Bruno Haible [Mon, 15 Jul 2019 00:36:28 +0000 (02:36 +0200)]
pthread-h: Prepare for adding new modules.

* lib/pthread.in.h: Define the types and macros for each of the
facilities separately.
* m4/pthread_h.m4 (gl_PTHREAD_H): Set HAVE_PTHREAD_CREATE_DETACHED,
HAVE_PTHREAD_MUTEX_RECURSIVE, HAVE_PTHREAD_MUTEX_ROBUST,
HAVE_PTHREAD_PROCESS_SHARED.
(gl_PTHREAD_H_DEFAULTS): Initialize HAVE_PTHREAD_CREATE_DETACHED,
HAVE_PTHREAD_MUTEX_RECURSIVE, HAVE_PTHREAD_MUTEX_ROBUST,
HAVE_PTHREAD_PROCESS_SHARED.
* modules/pthread-h (Makefile.am): Substitute
HAVE_PTHREAD_CREATE_DETACHED, HAVE_PTHREAD_MUTEX_RECURSIVE,
HAVE_PTHREAD_MUTEX_ROBUST, HAVE_PTHREAD_PROCESS_SHARED.

5 years agopthread-h: Add declarations of essential pthread functions.
Bruno Haible [Mon, 15 Jul 2019 00:36:24 +0000 (02:36 +0200)]
pthread-h: Add declarations of essential pthread functions.

* lib/pthread.in.h: Include snippets.
(pthread_create, pthread_attr_init, pthread_attr_getdetachstate,
pthread_attr_setdetachstate, pthread_attr_destroy, pthread_self,
pthread_equal, pthread_detach, pthread_join, pthread_exit, pthread_once,
pthread_mutex_init, pthread_mutexattr_init, pthread_mutexattr_gettype,
pthread_mutexattr_settype, pthread_mutexattr_getrobust,
pthread_mutexattr_setrobust, pthread_mutexattr_destroy,
pthread_mutex_lock, pthread_mutex_trylock, pthread_mutex_unlock,
pthread_mutex_destroy, pthread_rwlock_init, pthread_rwlockattr_init,
pthread_rwlockattr_destroy, pthread_rwlock_rdlock,
pthread_rwlock_wrlock, pthread_rwlock_tryrdlock,
pthread_rwlock_trywrlock, pthread_rwlock_timedrdlock,
pthread_rwlock_timedwrlock, pthread_rwlock_unlock,
pthread_rwlock_destroy, pthread_cond_init, pthread_condattr_init,
pthread_condattr_destroy, pthread_cond_wait, pthread_cond_timedwait,
pthread_cond_signal, pthread_cond_broadcast, pthread_cond_destroy,
pthread_key_create, pthread_setspecific, pthread_getspecific,
pthread_key_delete, pthread_spin_init, pthread_spin_lock,
pthread_spin_trylock, pthread_spin_unlock, pthread_spin_destroy): New
declarations.
(pthread_mutex_timedlock): Move declaration.
* m4/pthread_h.m4 (gl_PTHREAD_H): Check whether the new functions are
declared.
(gl_PTHREAD_H_DEFAULTS): Initialize GNULIB_PTHREAD_THREAD,
GNULIB_PTHREAD_ONCE, GNULIB_PTHREAD_MUTEX, GNULIB_PTHREAD_RWLOCK,
GNULIB_PTHREAD_COND, GNULIB_PTHREAD_TSS, GNULIB_PTHREAD_SPIN and the
HAVE_* and REPLACE_* variables for the new functions.
* modules/pthread-h (Depends-on): Add snippet/c++defs,
snippet/_Noreturn, snippet/arg-nonnull, snippet/warn-on-use.
(Makefile.am): Substitute GNULIB_PTHREAD_THREAD, GNULIB_PTHREAD_ONCE,
GNULIB_PTHREAD_MUTEX, GNULIB_PTHREAD_RWLOCK, GNULIB_PTHREAD_COND,
GNULIB_PTHREAD_TSS, GNULIB_PTHREAD_SPIN and the HAVE_* and REPLACE_*
variables for the new functions. Split the sed script, to avoid the
limit of 99 commands of HP-UX sed.
* tests/test-pthread-c++.cc: Check the signature of the new functions.

5 years agopthread-h: Respect --enable-threads={posix|windows} option on mingw.
Bruno Haible [Mon, 15 Jul 2019 00:36:21 +0000 (02:36 +0200)]
pthread-h: Respect --enable-threads={posix|windows} option on mingw.

* m4/pthread_h.m4 (gl_PTHREAD_H): Require gl_THREADLIB. Set
HAVE_PTHREAD_H if gl_threads_api is 'windows'.
(LIB_PTHREAD): Rely on $LIBMULTITHREAD from threadlib.m4.
* modules/pthread (Link): Change to $(LIBMULTITHREAD).
* modules/pthread-h (Depends-on): Add threadlib.
(Link): Change to $(LIBTHREAD).
* modules/pthread-h-c++-tests (test_pthread_c___LDADD): Use
$(LIBMULTITHREAD) instead of $(LIB_PTHREAD).

5 years agopthread-h: Add C++ tests.
Bruno Haible [Mon, 15 Jul 2019 00:36:19 +0000 (02:36 +0200)]
pthread-h: Add C++ tests.

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

5 years agopthread-h: Add tests.
Bruno Haible [Mon, 15 Jul 2019 00:36:16 +0000 (02:36 +0200)]
pthread-h: Add tests.

* tests/test-pthread.c: New file.
* modules/pthread-h-tests: New file.

5 years agopthread-h: New module.
Bruno Haible [Mon, 15 Jul 2019 00:36:13 +0000 (02:36 +0200)]
pthread-h: New module.

* lib/pthread.in.h: Define replacement functions only if GNULIB_PTHREAD
is 1.
* m4/pthread_h.m4: Renamed from m4/pthread.m4.
(gl_PTHREAD_H): Renamed from gl_PTHREAD_CHECK. Don't test whether
<pthread.h> pollutes the namespace; instead, prepare for generating a
pthread.h always. Substitute HAVE_PTHREAD_H here.
(gl_PTHREAD_H_DEFAULTS): Renamed from gl_PTHREAD_DEFAULTS. Initialize
GNULIB_PTHREAD. Don't initialize HAVE_PTHREAD_H here.
* modules/pthread-h: New file, based on modules/pthread.
* modules/pthread: Rely on 'pthread-h'.
* m4/pthread_mutex_timedlock.m4 (gl_FUNC_PTHREAD_MUTEX_TIMEDLOCK):
Update.
* modules/pthread_mutex_timedlock (Depends-on): Add pthread-h. Remove
pthread.

5 years agosched_yield: New module.
Bruno Haible [Mon, 15 Jul 2019 00:36:10 +0000 (02:36 +0200)]
sched_yield: New module.

* lib/sched.in.h: Add _GL_FUNCDECL_RPL, _GL_WARN_ON_USE placeholders.
(sched_yield): New declaration.
* lib/sched_yield.c: New file.
* m4/sched_yield.m4: New file.
* m4/sched_h.m4 (gl_SCHED_H): Require gl_SCHED_H_DEFAULTS. Arrange to
provide a replacement sched.h always. Test whether sched_yield is
declared.
(gl_SCHED_MODULE_INDICATOR, gl_SCHED_H_DEFAULTS): New macros.
* modules/sched (Depends-on): Add snippet/c++defs, snippet/warn-on-use.
(Makefile.am): Provide a replacement sched.h always. Substitute
GNULIB_SCHED_YIELD, HAVE_SCHED_YIELD, REPLACE_SCHED_YIELD,
_GL_FUNCDECL_RPL, _GL_WARN_ON_USE.
* modules/sched_yield: New file.
* doc/posix-functions/sched_yield.texi: Mention the new module.

5 years agowindows-spin: New module.
Bruno Haible [Mon, 15 Jul 2019 00:36:08 +0000 (02:36 +0200)]
windows-spin: New module.

* lib/windows-spin.h: New file.
* lib/windows-spin.c: New file.
* modules/windows-spin: New file.

5 years agowindows-timedrwlock: New module.
Bruno Haible [Mon, 15 Jul 2019 00:36:05 +0000 (02:36 +0200)]
windows-timedrwlock: New module.

* lib/windows-timedrwlock.h: New file, based on windows-rwlock.h.
* lib/windows-timedrwlock.c: New file, based on windows-rwlock.c and
windows-cond.c.
* lib/windows-cond.h (struct glwthread_waitqueue_link): Protect against
redefinition conflict with windows-timedrwlock.h.
* modules/windows-timedrwlock: New file.

5 years agowindows-rwlock: New module.
Bruno Haible [Mon, 15 Jul 2019 00:36:02 +0000 (02:36 +0200)]
windows-rwlock: New module.

* lib/windows-rwlock.h: New file, extracted from lib/glthread/lock.h.
* lib/windows-rwlock.c: New file, extracted from lib/glthread/lock.c.
* lib/glthread/lock.h: Include windows-rwlock.h. Don't include
windows-initguard.h.
(gl_rwlock_t): Define using glwthread_rwlock_t.
(gl_rwlock_initializer): Define using GLWTHREAD_RWLOCK_INIT.
(glthread_rwlock_init): Define using glwthread_rwlock_init.
(glthread_rwlock_rdlock): Define using glwthread_rwlock_rdlock.
(glthread_rwlock_wrlock): Define using glwthread_rwlock_wrlock.
(glthread_rwlock_unlock): Define using glwthread_rwlock_unlock.
(glthread_rwlock_destroy): Define using glwthread_rwlock_destroy.
(glthread_rwlock_init_func, glthread_rwlock_rdlock_func,
glthread_rwlock_wrlock_func, glthread_rwlock_unlock_func,
glthread_rwlock_destroy_func): Remove declarations.
* lib/glthread/lock.c (gl_waitqueue_t): Remove type.
(gl_waitqueue_init, gl_waitqueue_add, gl_waitqueue_notify_first,
gl_waitqueue_notify_all, glthread_rwlock_init_func,
glthread_rwlock_rdlock_func, glthread_rwlock_wrlock_func,
glthread_rwlock_unlock_func, glthread_rwlock_destroy_func): Remove
functions.
* modules/windows-rwlock: New file.
* modules/lock (Depends-on): Add windows-rwlock.

5 years agowindows-thread: Add support for creating a thread in detached state.
Bruno Haible [Mon, 15 Jul 2019 00:35:58 +0000 (02:35 +0200)]
windows-thread: Add support for creating a thread in detached state.

* lib/windows-thread.h (GLWTHREAD_ATTR_DETACHED): New macro.
(glwthread_thread_create): Add attr argument.
* lib/windows-thread.c (glwthread_thread_create): Likewise.
* lib/glthread/thread.h (glthread_create): Update.
* lib/thrd.c (thrd_create): Update.

5 years agowindows-*: Rename glwthread_spinlock_t to glwthread_initguard_t.
Bruno Haible [Mon, 15 Jul 2019 00:35:56 +0000 (02:35 +0200)]
windows-*: Rename glwthread_spinlock_t to glwthread_initguard_t.

* lib/windows-initguard.h: Renamed from lib/windows-spinlock.h.
(glwthread_initguard_t): Renamed from glwthread_spinlock_t.
(GLWTHREAD_INITGUARD_INIT): Renamed from GLWTHREAD_SPINLOCK_INIT.
* lib/windows-mutex.h: Update.
* lib/windows-recmutex.h: Likewise.
* lib/windows-timedmutex.h: Likewise.
* lib/windows-timedrecmutex.h: Likewise.
* lib/windows-cond.h: Likewise.
* lib/glthread/lock.h: Likewise.
* modules/windows-mutex (Files): Add lib/windows-initguard.h. Remove
lib/windows-spinlock.h.
* modules/windows-recmutex (Files): Likewise.
* modules/windows-timedmutex (Files): Likewise.
* modules/windows-timedrecmutex (Files): Likewise.
* modules/windows-cond (Files): Likewise.
* modules/threads-h (Files): Likewise.

5 years agodoc: Fix info about pthread API in HP-UX.
Bruno Haible [Mon, 15 Jul 2019 00:35:53 +0000 (02:35 +0200)]
doc: Fix info about pthread API in HP-UX.

* doc/posix-functions/pthread_*.texi: Fix info about HP-UX 11.

5 years agoFix typo in comment.
Bruno Haible [Mon, 15 Jul 2019 00:35:50 +0000 (02:35 +0200)]
Fix typo in comment.

* tests/test-cnd.c (EXPLICIT_YIELD): Fix typo in comment.
* tests/test-tss.c (EXPLICIT_YIELD): Likewise.
* tests/test-thread_local.c (EXPLICIT_YIELD): Likewise.

5 years agothreads-h: Fix generation of threads.h.
Bruno Haible [Mon, 15 Jul 2019 00:35:46 +0000 (02:35 +0200)]
threads-h: Fix generation of threads.h.

* modules/threads-h (Makefile.am): Insert the required header file
snippets.

5 years agostriconveh test: Fix a compilation failure when iconv is not available.
Bruno Haible [Tue, 9 Jul 2019 06:45:16 +0000 (08:45 +0200)]
striconveh test: Fix a compilation failure when iconv is not available.

Reported by Tom G. Christensen <tgc@jupiterrise.com>.

* tests/test-striconveh.c (main): Move iconv_close invocations inside
HAVE_ICONV.

5 years agoargmatch: adjust columns for help2man.
Akim Demaille [Sun, 7 Jul 2019 10:12:25 +0000 (12:12 +0200)]
argmatch: adjust columns for help2man.

* lib/argmatch.h (argmatch_##Name##_doc_col): If some argument
requires column 20 or more, return 20.

5 years agoareadlink-with-size: avoid realloc when size==0
Paul Eggert [Sun, 7 Jul 2019 02:25:24 +0000 (19:25 -0700)]
areadlink-with-size: avoid realloc when size==0

* lib/areadlink-with-size.c (areadlink_with_size):
* lib/areadlinkat-with-size.c (areadlinkat_with_size):
Reallocate at the end to the actual size, to avoid memory waste,
as suggested by Bruno Haible.  But when the guessed size is zero -
useful when the size is unknown - do the initial small readlink
into the stack, to avoid that realloc in the usual case.

5 years agoareadlink-with-size: guess a buffer size with 0 size
Pádraig Brady [Sat, 6 Jul 2019 18:43:11 +0000 (19:43 +0100)]
areadlink-with-size: guess a buffer size with 0 size

The size is usually taken from st_size, which can be zero,
resulting in inefficient operation as seen with:

  $ strace -e readlink stat -c %N /proc/$$/cwd
  readlink("/proc/9036/cwd", "/", 1)      = 1
  readlink("/proc/9036/cwd", "/h", 2)     = 2
  readlink("/proc/9036/cwd", "/hom", 4)   = 4
  readlink("/proc/9036/cwd", "/home/pa", 8) = 8
  readlink("/proc/9036/cwd", "/home/padraig", 16) = 13

Instead let zero select an initial memory allocation
of 128 bytes, which most symlinks fit within.

* lib/areadlink-with-size.c (areadlink_with_size):
Start with a 128 byte buffer, for SIZE == 0.
* lib/areadlinkat-with-size.c (areadlinkat_with_size): Likewise.

5 years agoReplace manually crafted hex regexes with [:xdigit:]
Konstantin Kharlamov [Sat, 6 Jul 2019 14:59:49 +0000 (07:59 -0700)]
Replace manually crafted hex regexes with [:xdigit:]

* build-aux/gitlog-to-changelog (parse_amend_file)
(git_dir_option):
Replace various combinations of [0-9a-fA-F] with [[:xdigit:]].
This patch is backported from Emacs (Bug#36167).

5 years agoerror: Fix documentation.
Bruno Haible [Sat, 6 Jul 2019 12:16:10 +0000 (14:16 +0200)]
error: Fix documentation.

* doc/glibc-functions/error_at_line.texi: Document what the 'error'
module provides.
* doc/glibc-functions/error_message_count.texi: Likewise.
* doc/glibc-functions/error_one_per_line.texi: Likewise.
* doc/glibc-functions/error_print_progname.texi: Likewise.

5 years agoautoupdate
Karl Berry [Sat, 6 Jul 2019 14:11:43 +0000 (07:11 -0700)]
autoupdate

5 years agodoc: Remove documentation of glibc <= 2.1.x as a supported platform.
Bruno Haible [Sat, 6 Jul 2019 12:02:27 +0000 (14:02 +0200)]
doc: Remove documentation of glibc <= 2.1.x as a supported platform.

* doc/gnulib-intro.texi (Target Platforms): Mention that glibc 2.1.x
and older is unsupported.
* doc/**/*.texi: Update.