]> Savannah Git Hosting - gnulib.git/log
gnulib.git
7 years ago[pygnulib] initial merge (including some small bug fixes)
Dmitry Selyutin [Sun, 20 Aug 2017 08:17:58 +0000 (11:17 +0300)]
[pygnulib] initial merge (including some small bug fixes)

7 years agohost-cpu-c-abi: Improve detection of MIPS ABI.
Bruno Haible [Sat, 19 Aug 2017 23:19:50 +0000 (01:19 +0200)]
host-cpu-c-abi: Improve detection of MIPS ABI.

* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): For MIPS, test the value of
_MIPS_SIM.

7 years agohypot tests: Fix test failure on FreeBSD 11.0/x86.
Bruno Haible [Thu, 17 Aug 2017 20:15:10 +0000 (22:15 +0200)]
hypot tests: Fix test failure on FreeBSD 11.0/x86.

* tests/test-hypot.h (test_function): Declare z as 'volatile'.

7 years agofloat: Fix LDBL_MIN value on FreeBSD/x86.
Bruno Haible [Thu, 17 Aug 2017 19:32:28 +0000 (21:32 +0200)]
float: Fix LDBL_MIN value on FreeBSD/x86.

* lib/float.in.h (LDBL_MIN) [__FreeBSD__]: Add more precision.

7 years agorandom: Fix test compilation failure on Cygwin 1.5.25.
Bruno Haible [Thu, 17 Aug 2017 12:17:58 +0000 (14:17 +0200)]
random: Fix test compilation failure on Cygwin 1.5.25.

* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize HAVE_DECL_INITSTATE,
HAVE_DECL_SETSTATE.
* m4/random.m4 (gl_FUNC_RANDOM): Test whether initstate and setstate are
declared.
* modules/stdlib (Makefile.am): Substitute HAVE_DECL_INITSTATE,
HAVE_DECL_SETSTATE.
* lib/stdlib.in.h (initstate): Declare also if HAVE_DECL_INITSTATE is 0.
(setstate): Declare also if HAVE_DECL_SETSTATE is 0.
* doc/posix-functions/initstate.texi: Mention the Cygwin 1.5.x problem.
* doc/posix-functions/random.texi: Likewise.
* doc/posix-functions/setstate.texi: Likewise.
* doc/posix-functions/srandom.texi: Likewise.

7 years agostdnoreturn: Fix test compilation failure on Cygwin.
Bruno Haible [Wed, 16 Aug 2017 23:59:11 +0000 (01:59 +0200)]
stdnoreturn: Fix test compilation failure on Cygwin.

* m4/stdnoreturn.m4 (gl_STDNORETURN_H): On Cygwin, use gnulib's
<stdnoreturn.h> replacement.
* lib/stdnoreturn.in.h (noreturn): Treat Cygwin like MSVC.
* doc/posix-headers/stdnoreturn.texi: Mention the Cygwin problem.

7 years agocloexec: spelling fixes in comments
Paul Eggert [Wed, 16 Aug 2017 20:59:54 +0000 (13:59 -0700)]
cloexec: spelling fixes in comments

7 years agothread: Fix conflict with pthread_sigmask module.
Bruno Haible [Wed, 16 Aug 2017 18:35:42 +0000 (20:35 +0200)]
thread: Fix conflict with pthread_sigmask module.

* lib/glthread/thread.h (pthread_sigmask): Don't declare it weak if
it's defined as a macro.
* modules/thread (Depends-on): Add pthread_sigmask.

7 years agorename: port better to NetBSD
Paul Eggert [Wed, 16 Aug 2017 15:34:41 +0000 (08:34 -0700)]
rename: port better to NetBSD

* doc/posix-functions/rename.texi (rename): NetBSD 7
does not have the link-count bug.
* m4/rename.m4 (gl_FUNC_RENAME): Don’t consider NetBSD to be
broken merely because rename ("a", "b") removes "a" when the two
names are hard links to the same file.

7 years agoiconv_open, uni*: Add support for VPATH builds with OpenBSD 'make'.
Bruno Haible [Wed, 16 Aug 2017 09:25:10 +0000 (11:25 +0200)]
iconv_open, uni*: Add support for VPATH builds with OpenBSD 'make'.

* modules/iconv_open (Makefile.am): In the rules that use gperf, prefix
the target file names with '$(srcdir)/'.
* modules/unicase/locale-language (Makefile.am): Likewise.
* modules/unicase/special-casing (Makefile.am): Likewise.
* modules/unictype/bidiclass-byname (Makefile.am): Likewise.
* modules/unictype/category-byname (Makefile.am): Likewise.
* modules/unictype/combining-class-byname (Makefile.am): Likewise.
* modules/unictype/joininggroup-byname (Makefile.am): Likewise.
* modules/unictype/joiningtype-byname (Makefile.am): Likewise.
* modules/unictype/property-byname (Makefile.am): Likewise.
* modules/unictype/scripts (Makefile.am): Likewise.
* modules/uninorm/composition (Makefile.am): Likewise.

7 years agononblocking-socket tests: Fix failure on OpenBSD 6.0.
Bruno Haible [Wed, 16 Aug 2017 09:04:30 +0000 (11:04 +0200)]
nonblocking-socket tests: Fix failure on OpenBSD 6.0.

* tests/test-nonblocking-socket.h (SOCKET_DATA_BLOCK_SIZE): Increase
value for OpenBSD.

7 years agorename, renameat: Update doc regarding NetBSD.
Bruno Haible [Wed, 16 Aug 2017 08:13:42 +0000 (10:13 +0200)]
rename, renameat: Update doc regarding NetBSD.

* doc/posix-functions/rename.texi: Clarify that when using
-D_XOPEN_SOURCE=500 on NetBSD 7.0, the hard link bug is gone.
* doc/posix-functions/renameat.texi: Be more precise about NetBSD
version.

7 years agorenameat2: port better to macOS
Paul Eggert [Wed, 16 Aug 2017 00:09:35 +0000 (17:09 -0700)]
renameat2: port better to macOS

* lib/renameat2.c (renameat2): Use renameatx_np if available.

7 years agofutimens: don’t assume struct timespec layout
Paul Eggert [Tue, 15 Aug 2017 23:47:22 +0000 (16:47 -0700)]
futimens: don’t assume struct timespec layout

* m4/futimens.m4 (gl_FUNC_FUTIMENS):
* m4/utimensat.m4 (gl_FUNC_UTIMENSAT):
* tests/test-fdutimensat.c (main):
* tests/test-futimens.h (test_futimens):
* tests/test-lutimens.h (test_lutimens):
* tests/test-utimens.h (test_utimens):
* tests/test-utimensat.c (main):
Don’t assume that struct timespec is a two-member structure in
tv_sec, tv_nsec order.  Although this is true on all platforms we
know about, POSIX does not guarantee it.

7 years agorename: document+test NetBSD rename
Paul Eggert [Tue, 15 Aug 2017 22:53:50 +0000 (15:53 -0700)]
rename: document+test NetBSD rename

Test failure reported by Bruno Haible in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-08/msg00104.html
This is an area where NetBSD is better-behaved than POSIX,
so allow the NetBSD behavior in tests.
* doc/posix-functions/rename.texi:
* doc/posix-functions/renameat.texi: Document NetBSD behavior.
* tests/test-rename.h (test_rename): Allow NetBSD behavior.

7 years agorenameat: Ensure declaration in <stdio.h> on NetBSD.
Bruno Haible [Tue, 15 Aug 2017 20:03:48 +0000 (22:03 +0200)]
renameat: Ensure declaration in <stdio.h> on NetBSD.

* lib/stdio.in.h: Include <unistd,h> also on NetBSD.
* doc/posix-functions/renameat.texi: Mention this problem.

7 years agoduplocale: Work around NetBSD 7.0 bug.
Bruno Haible [Tue, 15 Aug 2017 19:18:44 +0000 (21:18 +0200)]
duplocale: Work around NetBSD 7.0 bug.

* m4/duplocale.m4 (gl_FUNC_DUPLOCALE): Test against the NetBSD 7.0 bug.
* lib/duplocale.c: Add comment about NetBSD problem.
* doc/posix-functions/duplocale.texi: Mention the NetBSD problem.

7 years agoduplocale tests: Verify use with *_l functions.
Bruno Haible [Tue, 15 Aug 2017 18:23:00 +0000 (20:23 +0200)]
duplocale tests: Verify use with *_l functions.

* modules/duplocale-tests (configure.ac): Test for uselocale and
some *_l functions.
* tests/test-duplocale.c (test_with_uselocale): New function, extracted
from main.
(get_locale_dependent_values_from, test_with_locale_parameter): New
functions.
(main): Test both test_with_uselocale and test_with_locale_parameter.

7 years agoextensions: Enable NetBSD specific extensions.
Bruno Haible [Mon, 14 Aug 2017 22:31:15 +0000 (00:31 +0200)]
extensions: Enable NetBSD specific extensions.

* m4/extensions.m4 (AC_USE_SYSTEM_EXTENSIONS): Define _NETBSD_SOURCE.

7 years agoopen, openat: Update doc about O_CLOEXEC.
Bruno Haible [Mon, 14 Aug 2017 22:48:25 +0000 (00:48 +0200)]
open, openat: Update doc about O_CLOEXEC.

* doc/posix-functions/open.texi: More concrete list of platforms.
* doc/posix-functions/openat.texi: Likewise.

7 years agoopen: support O_CLOEXEC
Paul Eggert [Mon, 14 Aug 2017 20:04:46 +0000 (13:04 -0700)]
open: support O_CLOEXEC

* NEWS, doc/posix-functions/open.texi:
* doc/posix-functions/openat.texi: Document this.
* lib/fcntl.in.h (O_CLOEXEC): Default to a nonzero value.
(GNULIB_defined_O_CLOEXEC): New symbol.
* lib/open.c: Include cloexec.h.
(open): Support O_CLOEXEC.
* lib/openat.c: Include cloexec.h.
(rpl_openat): Support O_CLOEXEC.
* lib/popen-safer.c: Do not include cloexec.h.
(open_noinherit): Remove.
(popen_safer): Use O_CLOEXEC instead of set_cloexec_flag.
* lib/save-cwd.c: Do not include cloexec.h.
(save_cwd): Use O_CLOEXEC instead of set_cloexec_flag.
* m4/open-cloexec.m4: New file.
* m4/open.m4 (gl_FUNC_OPEN): Require gl_PREPROC_O_CLOEXEC.
Replace 'open' if O_CLOEXEC is not present.
* m4/openat.m4 (gl_FUNC_OPENAT): Require gl_PREPROC_O_CLOEXEC.
Replace 'openat' if O_CLOEXEC is not present.
* modules/freopen (Depends-on): Depend on 'open' if replacing freopen.
* modules/open (Files): Add m4/open-cloexec.m4.
(Depends-on): Depend on cloexec if replacing 'open'.
* modules/openat (Files): Add m4/open-cloexec.m4.
(Depends-on): Depend on cloexec if replacing openat.
* modules/popen-safer (Depends-on): Remove cloexec.
* modules/save-cwd (Depends-on): Remove cloexec, and add
fd-safer-flag and 'open'.

7 years ago* lib/reallocarray.c: Fix layout.
Paul Eggert [Sun, 13 Aug 2017 18:03:40 +0000 (11:03 -0700)]
* lib/reallocarray.c: Fix layout.

7 years agoreallocarray: minor fixes
Paul Eggert [Sun, 13 Aug 2017 17:55:55 +0000 (10:55 -0700)]
reallocarray: minor fixes

* doc/glibc-functions/reallocarray.texi: Update version numbers.
* m4/reallocarray.m4 (gl_FUNC_REALLOCARRAY): Don't trust _cv_ contents.
* modules/reallocarray (License): Change from GPL to LGPL.
* tests/test-reallocarray.c (main): Fix ENOMEM typo.
Indent properly and don't use tabs.

7 years agoreallocarray: New module
Darshit Shah [Sun, 13 Aug 2017 17:13:33 +0000 (10:13 -0700)]
reallocarray: New module

reallocarray is a new function in glibc 2.26 to safely allocate an array
of memory locations with integer overflow protection.
* MODULES.html.sh: Add reallocarray.
* doc/glibc-functions/reallocarray.texi: Documentation for reallocarray.
* lib/reallocarray.c: New file to implement module reallocarray.
* lib/stdlib.in.h: Add function declarations for reallocarray.
* m4/reallocarray.m4: New file.
* m4/stdlib_h.m4: Declare reallocarray.
* modules/reallocarray: New file.
* modules/reallocarray-test: New file.
* modules/stdlib: Coerce stdlib.h to export reallocarray.
* tests/test-reallocarray.c: New test.

7 years agodirent-safer: fix cloexec race
Paul Eggert [Sat, 12 Aug 2017 18:34:50 +0000 (11:34 -0700)]
dirent-safer: fix cloexec race

* lib/opendir-safer.c: Include fcntl.h instead of unistd-safer.h.
(opendir_safer): Use F_DUPFD_CLOEXEC.
* modules/dirent-safer (Depends-on): Add fcntl.  Remove unistd-safer.
* tests/test-dirent-safer.c: Do not include unistd-safer.h,
as it is no longer a prerequisite.  Use F_DUPFD_CLOEXEC
instead of dup_safer.

7 years agofts: fix cloexec races
Paul Eggert [Sat, 12 Aug 2017 18:20:41 +0000 (11:20 -0700)]
fts: fix cloexec races

* lib/fts.c [!_LIBC]: Do not include dirent--.h, unistd--.h, cloexec.h.
(opendirat, diropen): Use O_CLOEXEC instead of set_cloexec_flag.
(fts_build): Use F_DUPD_CLOEXEC rinstad of set_cloexec_flag.
(fd_ring_check): Set cloexec flag on new file descriptors.
(fts_build, fd_ring_check): While we’re at it, make sure the
resulting file descriptor is not 0, 1, or 2, since that is easy.
* modules/fts (Depends-on): Remove cloexec, dirent-safer, dup,
fcntl-safer, unistd-safer.  Add fcntl.

7 years agofts tests: Fix link error.
Bruno Haible [Fri, 11 Aug 2017 18:43:35 +0000 (20:43 +0200)]
fts tests: Fix link error.

Reported by Tom G. Christensen in
https://lists.gnu.org/archive/html/bug-gnulib/2017-08/msg00078.html

* modules/fts-tests (Makefile.am): Link test-fts against LIBINTL.

7 years agofts: port recent changes to CentOS 6
Paul Eggert [Thu, 10 Aug 2017 13:06:06 +0000 (06:06 -0700)]
fts: port recent changes to CentOS 6

Problem reported by Tom G. Christensen in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-08/msg00064.html
* lib/fts.c (fsword): New type.
(struct dev_type, filesystem_type): Use it.
* m4/fts.m4 (gl_FUNC_FTS_CORE): Check for __fsword_t.
Also, check for f_type only if fstatfs and sys/vfs.h work.

7 years agoautoupdate
Karl Berry [Wed, 9 Aug 2017 22:56:01 +0000 (15:56 -0700)]
autoupdate

7 years agotempname: do not depend on secure_getenv
Paul Eggert [Wed, 9 Aug 2017 18:30:36 +0000 (11:30 -0700)]
tempname: do not depend on secure_getenv

Excess dependency noted by Eli Zaretskii (Bug#28023#17).
* lib/tempname.c (__secure_getenv) [!_LIBC]: Remove; unused.
* modules/tempname (Depends-on): Remove secure_getenv.

7 years agoextensions: add _OPENBSD_SOURCE
Paul Eggert [Tue, 8 Aug 2017 18:07:06 +0000 (11:07 -0700)]
extensions: add _OPENBSD_SOURCE

* m4/extensions.m4 (AC_USE_SYSTEM_EXTENSIONS): Define _OPENBSD_SOURCE.

7 years agomanywarnings: Add support for C++.
Reuben Thomas [Mon, 7 Aug 2017 20:08:13 +0000 (22:08 +0200)]
manywarnings: Add support for C++.

* build-aux/g++-warning.spec: New file.
* m4/manywarnings-c++.m4: New file.
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C++)): New macro, that
redirects to manywarnings-c++.m4.
* modules/manywarnings (Files): Add m4/manywarnings-c++.m4.

7 years agomanywarnings: Add support for C++.
Reuben Thomas [Mon, 7 Aug 2017 15:32:18 +0000 (17:32 +0200)]
manywarnings: Add support for C++.

* build-aux/g++-warning.spec: New file.
* m4/manywarnings-c++.m4: New file.
* modules/manywarnings (Files): Add it.

7 years agogit-version-gen: another fix for tags with "-"
Paul Eggert [Mon, 7 Aug 2017 06:24:10 +0000 (23:24 -0700)]
git-version-gen: another fix for tags with "-"

* build-aux/git-version-gen: Improve fix for tags containing "-".
Suggested by Markus Armbruster in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-08/msg00034.html

7 years agowarnings, manywarnings: Add support for multiple languages, not just C.
Bruno Haible [Sun, 6 Aug 2017 22:40:41 +0000 (00:40 +0200)]
warnings, manywarnings: Add support for multiple languages, not just C.

* warnings.m4 (gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL): Renamed from
gl_UNKNOWN_WARNINGS_ARE_ERRORS.
(gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)): New macro.
(gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)): New macro.
(gl_UNKNOWN_WARNINGS_ARE_ERRORS): Dispatch to
gl_UNKNOWN_WARNINGS_ARE_ERRORS(_AC_LANG).
(gl_WARN_ADD): Require the gl_UNKNOWN_WARNINGS_ARE_ERRORS specialization
of the current language. If C++ is the current language, modify
WARN_CXXFLAGS instead of WARN_CFLAGS.
* manywarnings.m4 (gl_MANYWARN_ALL_GCC(C)): New macro, extracted from
gl_MANYWARN_ALL_GCC.
(gl_MANYWARN_ALL_GCC): Dispatch to gl_MANYWARN_ALL_GCC(_AC_LANG).

7 years agogit-version-gen: port better to older Git
Paul Eggert [Sun, 6 Aug 2017 16:21:05 +0000 (09:21 -0700)]
git-version-gen: port better to older Git

Work even if the hash contains more than 4 digits.

7 years agogit-version-gen: Fix for tags containing '-'
Markus Armbruster [Sun, 6 Aug 2017 06:26:03 +0000 (08:26 +0200)]
git-version-gen: Fix for tags containing '-'

Really old versions of git-describe (before v1.5.0, Feb 2007) don't
have the number of commits in their long format output, i.e. where
modern 'git describe --abbrev=4 --match="v*"' prints
"v0.1-1494-g124b9", they print "v0.1-1494-g124b9".  git-version-gen
recognizes both patterns, and normalizes the old format to the new
one.

Unfortunately, this normalization code gets confused when the tag
contains '-'.  Reproducer:

    $ git-tag -m test v0.2-rc1
    $ build-aux/git-version-gen .tarball-version; echo
    build-aux/git-version-gen: WARNING: git rev-list failed
    UNKNOWN

We take exact tag "v0.2-rc1" for the old format, extract the presumed
tag "v0.2" from it, then run "git rev-list v0.2..HEAD" to count
commits since tha tag.  Fails, because tag "v0.2" does not exist.

* git-version-gen: We could perhaps drop support for versions from more
than a decade ago.  But tightening the pattern match is easy enough,
so do that.  Still breaks when you use version tags ending in something
matching -g????, but you arguably get what you deserve then.

7 years agovalgrind-tests: use ls, and cache
Paul Eggert [Sat, 5 Aug 2017 18:45:10 +0000 (11:45 -0700)]
valgrind-tests: use ls, and cache

* m4/valgrind-tests.m4: Test ls, not bash.
Problem reported by Reuben Thomas.
Also, cache the result so that it can be overridden.

7 years agomanywarnings: port to 64-bit GCC builds of Emacs
Paul Eggert [Fri, 4 Aug 2017 22:14:59 +0000 (15:14 -0700)]
manywarnings: port to 64-bit GCC builds of Emacs

* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Compute max safe
object size rather than hardwiring 2147483647.  This is needed to
build GNU Emacs, which has one conditional (and used
only-in-theory) call to malloc with a literal greater than
2147483647.

7 years agoRelax the license of some modules with no runtime code.
Bruno Haible [Fri, 4 Aug 2017 09:57:20 +0000 (11:57 +0200)]
Relax the license of some modules with no runtime code.

7 years agorenameat2: port to RHEL 7 + NFS
Paul Eggert [Thu, 3 Aug 2017 23:28:18 +0000 (16:28 -0700)]
renameat2: port to RHEL 7 + NFS

* lib/renameat2.c (renameat2) [SYS_renameat2]:
Port to RHEL 7 + NFS.  Problem reported by Ted Zlatanov in:
http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00082.html

7 years agorenameat2: port to non-renameat platforms
Paul Eggert [Wed, 2 Aug 2017 18:06:33 +0000 (11:06 -0700)]
renameat2: port to non-renameat platforms

Problem reported for MSVC-2015 by Gisle Vanem in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-08/msg00001.html
* lib/renameat2.c [!HAVE_RENAMEAT]: Include <sys/stat.h> here too.
(renameat2) [!HAVE_RENAMEAT]: Fix typo in arg passing.

7 years agomanywarnings: port to 32-bit GCC bug
Paul Eggert [Tue, 1 Aug 2017 16:52:40 +0000 (09:52 -0700)]
manywarnings: port to 32-bit GCC bug

Problem reported by Pino Toscano in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-07/msg00150.html
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Use 2**31 - 1,
not 2**63 - 1, to work around the following GCC bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81650

7 years agobackupfile: new function to validate backup suffix
Paul Eggert [Mon, 31 Jul 2017 00:05:06 +0000 (17:05 -0700)]
backupfile: new function to validate backup suffix

* lib/backupfile.c (set_simple_backup_suffix): New function.
Also, reject suffixes containing "/".
(backupfile_internal): Use it.

7 years agocanonicalize: fix EOVERFLOW commentary
Paul Eggert [Sun, 30 Jul 2017 22:38:56 +0000 (15:38 -0700)]
canonicalize: fix EOVERFLOW commentary

Problem reported by Bruno Haible in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-07/msg00147.html
* lib/canonicalize.c (canonicalize_filename_mode):
* lib/canonicalize-lgpl.c (__realpath): Fix comments.

7 years agoDon't interpret EOVERFLOW to mean nonexistence
Paul Eggert [Sun, 30 Jul 2017 20:06:41 +0000 (13:06 -0700)]
Don't interpret EOVERFLOW to mean nonexistence

* lib/fts.c (fts_stat): If lstat fails, report its errno, which
may be EOVERFLOW; this is likely more useful than reporting the
stat errno.
* lib/glob.c (link_stat): Rename from link_exists2_p and
return -1/0 instead of 0/1.  Caller changed.
* lib/glob.c (link_exists_p):
* lib/renameat2.c (rename_noreplace, renameat2):
* lib/tempname.c (try_nocreate):
If errno == EOVERFLOW then the directory entry exists, so do not
act as if it does not exist.

7 years agobackup-rename: new module
Paul Eggert [Sun, 30 Jul 2017 17:53:32 +0000 (10:53 -0700)]
backup-rename: new module

It is like backupfile, except it avoids some race conditions,
and it does not output to stderr or exit.
* MODULES.html.sh: Add backup-rename.
* lib/backup-find.c, lib/backup-internal.h, lib/backup-rename.c:
* modules/backup-rename: New files.
* lib/backupfile.c: Turn this into an internals file, which
contains code common to backupfile and backup_rename.  Do not
include argmatch.h or xalloc.h: include xalloc-oversized.h.
Include renameat2.h and fcntl.h.
(BACKUP_NOMEM): New constant.
(numbered_backup): New args BASE_OFFSET and *DIRPP.  Do not exit
on memory exhaustion; just return BACKUP_NOMEM.  Caller changed.
(backupfile_internal): Rename from find_backup_file_name.
Support new arg RENAME.
(backup_args, backup_types, get_version, xget_version):
Move to lib/backup-find.c.
* lib/backupfile.h (backup_file_rename): New decl.
* modules/backupfile (Files): Add lib/backup-internal.h,
lib/backup-find.c.
(Depends-on): Add dirfd, fcntl, renameat2.
(lib_SOURCES): Add backup-find.c.

7 years agorenameat2: port better to older Solaris
Paul Eggert [Sun, 30 Jul 2017 17:53:32 +0000 (10:53 -0700)]
renameat2: port better to older Solaris

* lib/renameat2.c (renameat2): Set ret_val properly on old Solaris.
Add goto to use a label, to silence picky compilers.

7 years agofts-tests: port to gcc -Wwrite-strings
Paul Eggert [Sun, 30 Jul 2017 17:53:32 +0000 (10:53 -0700)]
fts-tests: port to gcc -Wwrite-strings

* tests/test-fts.c (base, base_d): New static vars.
(argv, remove_tree, main): Use them.

7 years agorelocatable-lib{,-lgpl}: improve documentation
Reuben Thomas [Sun, 30 Jul 2017 11:54:08 +0000 (13:54 +0200)]
relocatable-lib{,-lgpl}: improve documentation

* doc/relocatable-maint.texi: Document use of relocatable-lib{,-lgpl}.
Various other updates.

7 years agorelocatable-lib{,-lgpl}: add Valgrind suppressions
Reuben Thomas [Sun, 30 Jul 2017 11:34:44 +0000 (13:34 +0200)]
relocatable-lib{,-lgpl}: add Valgrind suppressions

* lib/relocatable.valgrind: New file.
* modules/relocatable-lib (Files): Add relocatable.valgrind.
* modules/relocatable-lib-lgpl: Likewise.

7 years agorelocatable: Make the license on the sources the GPL.
Reuben Thomas [Sun, 30 Jul 2017 11:16:11 +0000 (13:16 +0200)]
relocatable: Make the license on the sources the GPL.

* lib/relocatable.h, lib/relocatable.c: Change the copyright notice from
LGPL, which was a special case so that the relocatable source files
could be used without gnulib-tool, to GPL. They can still be used under
the LGPL, using the --lgpl option to gnulib-tool.

7 years agohost-cpu-c-abi: Detect ILP32 ABI on IA-64 HP-UX.
Bruno Haible [Sun, 30 Jul 2017 10:39:01 +0000 (12:39 +0200)]
host-cpu-c-abi: Detect ILP32 ABI on IA-64 HP-UX.

* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): Distinguish ia64-ilp32
from ia64. For arm64, test only __aarch64__, as __ARM_64BIT_STATE and
__ARM_PCS_AAPCS64 are not reliable indicators: they are not defined on
Ubuntu 14.04 (gcc 4.8.4) and Debian 8 (gcc 4.9.2).

7 years agofaccessat: document AT_SYMLINK_NOFOLLOW issue
Paul Eggert [Fri, 28 Jul 2017 01:02:18 +0000 (18:02 -0700)]
faccessat: document AT_SYMLINK_NOFOLLOW issue

* doc/posix-functions/faccessat.texi: Modernize platform list.
Document AT_SYMLINK_NOFOLLOW limitation.

7 years agorenameat2: port to Solaris 10
Paul Eggert [Thu, 27 Jul 2017 23:36:03 +0000 (16:36 -0700)]
renameat2: port to Solaris 10

* lib/renameat2.c (rename_noreplace): Use lstat, not faccessat
with AT_SYMLINK_NOFOLLOW (which is not portable).
(renameat): Undef before using, to avoid endless recursion when
the replacement renameat calls renameat2 which calls the
replacement renameat.
(renameat2): Use lstatat, not faccessat with AT_SYMLINK_NOFOLLOW.
* modules/renameat2 (Depends-on): Remove faccessat.
* modules/renameat-tests (test_renameat_LDADD):
* modules/renameat2-tests (test_renameat2_LDADD):
Remove $(LIB_EACCESS).

7 years agorenameat2: new module
Paul Eggert [Thu, 27 Jul 2017 19:08:39 +0000 (12:08 -0700)]
renameat2: new module

Although the Linux syscall renameat2 is not in glibc (yet?), it is
useful to have access to its RENAME_NOREPLACE flag.
* MODULES.html.sh (func_all_modules): Add renameat2.
* lib/renameat2.c, lib/renameat2.h, modules/renameat2:
* modules/renameat2-tests, tests/test-renameat2.c: New files.
* lib/renameat.c (renameat): Move most of the implementation
to renameat2, and just call renameat2.
* modules/renameat (Files): Remove lib/at-func2.c.
(Depends-on): Depend only on renameat2.
(Include): Remove <fcntl.h>.
* modules/renameat-tests (test_renameat_LDADD): Add $(LIB_EACCESS),
since renameat (via renameat2) might use faccessat.

7 years agovc-list-files: Adjust the script to support git worktrees
Erik Skultety [Thu, 27 Jul 2017 11:47:23 +0000 (13:47 +0200)]
vc-list-files: Adjust the script to support git worktrees

Git's worktree feature creates a ".git" which refers to references from
the original (main) repository. This makes vc-list-files to fail for
worktrees since it checks for both file's existence and the file being a
directory. Checking for existence should be okay in this case, since the
script doesn't touch anything within ".git" directly. Instead, it
invokes git commands, which work from within a worktree nicely.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Message-Id: <0ad867fe1a1e0999e6666ef75398630f28e78e35.1501156018.git.eskultet@redhat.com>

7 years agomaint: bring MODULES.html.sh up to date
Paul Eggert [Wed, 26 Jul 2017 18:57:37 +0000 (11:57 -0700)]
maint: bring MODULES.html.sh up to date

Somehow a few months ago we stopped updating MODULES.html.sh.
I don’t recall explicitly deciding this, so I updated it now.
Alternatively I suppose we could remove it.
* MODULES.html.sh: Add builtin-expect, c99, ctime, explicit_bzero,
localtime, localtime-buffer, noreturn, nstrftime, strftime-fixes,
truncate, utime, utime-h, windows-stat-inodes,
windows-stat-override, windows-stat-timespec, year2038.  Sort.

7 years agofprintftime: fix build-break caused by recent renaming
Jim Meyering [Wed, 26 Jul 2017 18:33:49 +0000 (11:33 -0700)]
fprintftime: fix build-break caused by recent renaming

* lib/fprintftime.c: Include "nstrftime.c", not the now-renamed
"strftime.c".
* modules/fprintftime: Depend directly on nstrftime.

7 years agoregex: work with GCC7's -Werror=implicit-fallthrough=
Paul Eggert [Wed, 26 Jul 2017 16:12:29 +0000 (09:12 -0700)]
regex: work with GCC7's -Werror=implicit-fallthrough=

* lib/regex_internal.h (FALLTHROUGH): New macro.
* lib/regcomp.c (peek_token_bracket, parse_expression):
* lib/regexec.c (check_node_accept): Use it.

7 years agofts: simplify fts_build
Paul Eggert [Tue, 25 Jul 2017 07:00:19 +0000 (00:00 -0700)]
fts: simplify fts_build

* lib/fts.c (fts_build): Simplify, and be lazier about
calling leaf_optimization.

7 years agofts: three levels of leaf optimization
Paul Eggert [Tue, 25 Jul 2017 06:54:00 +0000 (23:54 -0700)]
fts: three levels of leaf optimization

* lib/fts.c (enum leaf_optimization): New type with three values.
(S_MAGIC_AFS): New macro.  Sort them.
(leaf_optimization): Rename from leaf_optimization_applies, and
return enum leaf_optimization instead of bool.  All uses changed.
Add cases for unknown type and for AFS.
(fts_build): Don’t rely on link counts if NO_LEAF_OPTIMIZATION.

7 years agofts: cache dirent_inode_sort_may_be_useful too
Paul Eggert [Tue, 25 Jul 2017 06:44:05 +0000 (23:44 -0700)]
fts: cache dirent_inode_sort_may_be_useful too

* lib/fts.c (struct dev_type): New struct.
(DEV_TYPE_HT_INITIAL_SIZE): New constant.
(dev_type_hash, dev_type_compare, filesystem_type): New functions.
(dirent_inode_sort_may_be_useful, leaf_optimization_applies):
Now takes FTSENT const *, not int.  All uses changed.  Use
filesystem_type to cache.
(link_count_optimize_ok): Remove.  Caller changed to use
leaf_optimization_applies, which now uses shared cache.

7 years agofts: introduce MIN_DIR_NLINK
Paul Eggert [Tue, 25 Jul 2017 06:28:26 +0000 (23:28 -0700)]
fts: introduce MIN_DIR_NLINK

* lib/fts.c (MIN_DIR_NLINK): New constant.
Use it instead of 2, whenever we are talking about link counts.

7 years agofts: nlink_t signedness fixups
Paul Eggert [Tue, 25 Jul 2017 06:21:57 +0000 (23:21 -0700)]
fts: nlink_t signedness fixups

* lib/fts.c (fts_open): Set rootparent n_dirs_remaining to -1
so that root need not be a special case later.
(fts_read): Remove now-redundant test for fts_level.
Do not assume that nlink_t is signed.
(fts_build): Remove useless decrement of nlinks.
(fts_stat): Avoid unlikely signed integer overflow later, if
nlink_t is signed.

7 years agofts-tests: new module
Paul Eggert [Tue, 25 Jul 2017 06:12:59 +0000 (23:12 -0700)]
fts-tests: new module

* modules/fts-tests, tests/test-fts.c: New files.

7 years agoRename module 'strftime' to 'nstrftime'.
Bruno Haible [Mon, 24 Jul 2017 08:34:25 +0000 (10:34 +0200)]
Rename module 'strftime' to 'nstrftime'.

* NEWS: Mention the change.

7 years agoRename module 'strftime' to 'nstrftime'.
Bruno Haible [Sun, 23 Jul 2017 23:19:36 +0000 (01:19 +0200)]
Rename module 'strftime' to 'nstrftime'.

* m4/nstrftime.m4: Renamed from m4/strftime.m4.
* lib/nstrftime.c: Renamed from lib/strftime.c.
* modules/nstrftime: Renamed from modules/strftime.
(Files, Makefile.am): Update.
* tests/test-nstrftime.c: Renamed from tests/test-strftime.c.
Fix comment.
* modules/nstrftime-tests: Renamed from modules/strftime-tests.
(Files, Makefile.am): Update.
* modules/strftime: New file, an obsolete indirection.
* doc/posix-functions/strftime.texi: Update reference.
* config/srclist.txt: Update info.

7 years agomalloca: Silence a warning from clang's memory sanitizer.
Tim Rühsen [Fri, 21 Jul 2017 21:18:21 +0000 (23:18 +0200)]
malloca: Silence a warning from clang's memory sanitizer.

* lib/malloca.c (NO_SANITIZE_MEMORY): New macro.
(freea): Use it.

7 years agoautoupdate
Karl Berry [Wed, 19 Jul 2017 14:56:20 +0000 (07:56 -0700)]
autoupdate

7 years agohost-cpu-c-abi: Fix detection of MIPS ABI.
Bruno Haible [Wed, 19 Jul 2017 00:35:23 +0000 (02:35 +0200)]
host-cpu-c-abi: Fix detection of MIPS ABI.

* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): For MIPS, really test the
ABI, not the CPU instruction set.

7 years agoexplicit_bzero: new module
Paul Eggert [Sun, 16 Jul 2017 14:26:16 +0000 (07:26 -0700)]
explicit_bzero: new module

The explicit_bzero function has been added to glibc.
This module is intended to supports its use in GNU programs.
* doc/glibc-functions/explicit_bzero.texi, lib/explicit_bzero.c:
* m4/explicit_bzero.m4, modules/explicit_bzero:
New files.
* doc/gnulib.texi (Glibc string.h): Link to new doc.
* lib/string.in.h (explicit_bzero): Declare.
* m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Add defaults for it.
* modules/string (string.h): Substitute its vars.

7 years agothreadlib: Support static linking.
Bruno Haible [Sun, 16 Jul 2017 12:49:21 +0000 (14:49 +0200)]
threadlib: Support static linking.

* m4/threadlib.m4 (gl_THREADLIB_BODY): When static linking is in use,
set gl_cv_have_weak to 'no'.

7 years agounicase/locale-language: Fix link dependencies.
Bruno Haible [Sun, 16 Jul 2017 12:21:55 +0000 (14:21 +0200)]
unicase/locale-language: Fix link dependencies.

* modules/unicase/locale-language (Link): New section.
* modules/unicase/locale-language-tests (Makefile.am): Link
test-locale-language program with $(LIBTHREAD).

7 years agosys_socket: Add support for OpenVMS.
John E. Malmberg [Sat, 15 Jul 2017 21:11:44 +0000 (23:11 +0200)]
sys_socket: Add support for OpenVMS.

* lib/sys_socket.in.h [__VMS]: Define CMSG_SPACE, CMSG_LEN.
* doc/posix-headers/sys_socket.texi: Mention OpenVMS issues.

7 years agosys_resource: Add support for OpenVMS.
John E. Malmberg [Sat, 15 Jul 2017 15:30:13 +0000 (17:30 +0200)]
sys_resource: Add support for OpenVMS.

* lib/resource.in.h [__VMS]: Define RUSAGE_SELF, RUSAGE_CHILDREN.
* doc/posix-headers/sys_resource.texi: Mention OpenVMS issues.

7 years agomath: Add support for OpenVMS.
John E. Malmberg [Sat, 15 Jul 2017 15:10:51 +0000 (17:10 +0200)]
math: Add support for OpenVMS.

* lib/math.in.h [__VMS]: Include <fp.h>.
* doc/posix-headers/math.texi: Mention OpenVMS issues.

7 years agogetdtablesize: Add minimal support for OpenVMS.
Bruno Haible [Sat, 15 Jul 2017 15:00:37 +0000 (17:00 +0200)]
getdtablesize: Add minimal support for OpenVMS.

Reported by John E. Malmberg <wb8tyw@qsl.net>.

* modules/getdtablesize (Description): Fix.
* lib/getdtablesize.c: Fix comment.
* m4/getdtablesize.m4 (gl_FUNC_GETDTABLESIZE): Don't replace the
getdtablesize() function, even though the test fails.
* doc/glibc-functions/getdtablesize.texi: Reference SUSv2. Describe
limitation on OpenVMS.

7 years agoRevisit cross-compilation guesses.
Bruno Haible [Thu, 13 Jul 2017 17:49:38 +0000 (19:49 +0200)]
Revisit cross-compilation guesses.

* m4/wctype_h.m4 (gl_WCTYPE_H): Add comment.

7 years agoImprove cross-compilation guesses for native Windows.
Bruno Haible [Thu, 13 Jul 2017 19:06:02 +0000 (21:06 +0200)]
Improve cross-compilation guesses for native Windows.

* m4/btowc.m4 (gl_FUNC_BTOWC): Add cross-compilation guess for native
Windows.
* m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Likewise.
* m4/calloc.m4 (_AC_FUNC_CALLOC_IF): Likewise.
* m4/canonicalize.m4 (gl_FUNC_REALPATH_WORKS): Likewise.
* m4/cbrtf.m4 (gl_FUNC_CBRTF_WORKS): Likewise.
* m4/cbrtl.m4 (gl_FUNC_CBRTL, gl_FUNC_CBRTL_WORKS): Likewise.
* m4/ceil.m4 (gl_FUNC_CEIL): Likewise.
* m4/ceilf.m4 (gl_FUNC_CEILF): Likewise.
* m4/ceill.m4 (gl_FUNC_CEILL): Likewise.
* m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Likewise.
* m4/dup.m4 (gl_FUNC_DUP): Likewise.
* m4/expl.m4 (gl_FUNC_EXPL): Likewise.
* m4/exp2.m4 (gl_FUNC_EXP2_WORKS): Likewise.
* m4/exp2l.m4 (gl_FUNC_EXP2L): Likewise.
* m4/expm1.m4 (gl_FUNC_EXPM1): Likewise.
* m4/expm1f.m4 (gl_FUNC_EXPM1F_WORKS): Likewise.
* m4/exponentl.m4 (gl_LONG_DOUBLE_EXPONENT_LOCATION): Likewise.
* m4/fabsl.m4 (gl_FUNC_FABSL_WORKS): Likewise.
* m4/fchdir.m4 (gl_FUNC_FCHDIR): Likewise.
* m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): Likewise.
* m4/float_h.m4 (gl_FLOAT_H): Likewise.
* m4/floor.m4 (gl_FUNC_FLOOR): Likewise.
* m4/floorf.m4 (gl_FUNC_FLOORF): Likewise.
* m4/fma.m4 (gl_FUNC_FMA_WORKS): Likewise.
* m4/fmaf.m4 (gl_FUNC_FMAF_WORKS): Likewise.
* m4/fmal.m4 (gl_FUNC_FMAL_WORKS): Likewise.
* m4/fmod.m4 (gl_FUNC_FMOD): Likewise.
* m4/fmodf.m4 (gl_FUNC_FMODF): Likewise.
* m4/fmodl.m4 (gl_FUNC_FMODL): Likewise.
* m4/frexp.m4 (gl_FUNC_FREXP_WORKS): Likewise.
* m4/frexpf.m4 (gl_FUNC_FREXPF_WORKS): Likewise.
* m4/ftello.m4 (gl_FUNC_FTELLO): Likewise.
* m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY_CLOBBER): Likewise.
* m4/hypot.m4 (gl_FUNC_HYPOT): Likewise.
* m4/hypotf.m4 (gl_FUNC_HYPOTF, gl_FUNC_HYPOTF_WORKS): Likewise.
* m4/hypotl.m4 (gl_FUNC_HYPOTL, gl_FUNC_HYPOTL_WORKS): Likewise.
* m4/ilogb.m4 (gl_FUNC_ILOGB_WORKS): Likewise.
* m4/ilogbf.m4 (gl_FUNC_ILOGBF_WORKS): Likewise.
* m4/isfinite.m4 (gl_ISFINITEL_WORKS): Likewise.
* m4/isinf.m4 (gl_ISINFL_WORKS): Likewise.
* m4/isnanf.m4 (gl_ISNANF_WORKS): Likewise.
* m4/isnanl.m4 (gl_FUNC_ISNANL_WORKS): Likewise.
* m4/ldexpl.m4 (gl_FUNC_LDEXPL_WORKS): Likewise.
* m4/log.m4 (gl_FUNC_LOG, gl_FUNC_LOG_WORKS): Likewise.
* m4/logf.m4 (gl_FUNC_LOGF, gl_FUNC_LOGF_WORKS): Likewise.
* m4/logl.m4 (gl_FUNC_LOGL_WORKS): Likewise.
* m4/log10.m4 (gl_FUNC_LOG10, gl_FUNC_LOG10_WORKS): Likewise.
* m4/log10f.m4 (gl_FUNC_LOG10F, gl_FUNC_LOG10F_WORKS): Likewise.
* m4/log10l.m4 (gl_FUNC_LOG10L_WORKS): Likewise.
* m4/log1p.m4 (gl_FUNC_LOG1P): Likewise.
* m4/log1pf.m4 (gl_FUNC_LOG1PF, gl_FUNC_LOG1PF_WORKS): Likewise.
* m4/log1pl.m4 (gl_FUNC_LOG1PL): Likewise.
* m4/log2.m4 (gl_FUNC_LOG2, gl_FUNC_LOG2_WORKS): Likewise.
* m4/log2f.m4 (gl_FUNC_LOG2F, gl_FUNC_LOG2F_WORKS): Likewise.
* m4/log2l.m4 (gl_FUNC_LOG2L_WORKS): Likewise.
* m4/logb.m4 (gl_FUNC_LOGB_WORKS): Likewise.
* m4/logbf.m4 (gl_FUNC_LOGBF_WORKS): Likewise.
* m4/logbl.m4 (gl_FUNC_LOGBL_WORKS): Likewise.
* m4/lstat.m4 (gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): Likewise.
* m4/mbrtowc.m4 (gl_MBRTOWC_EMPTY_INPUT, gl_MBRTOWC_C_LOCALE): Likewise.
* m4/mkdir.m4 (gl_FUNC_MKDIR): Likewise.
* m4/mkstemp.m4 (gl_FUNC_MKSTEMP): Likewise.
* m4/mktime.m4 (gl_FUNC_MKTIME_WORKS): Likewise.
* m4/modf.m4 (gl_FUNC_MODF): Likewise.
* m4/modff.m4 (gl_FUNC_MODFF): Likewise.
* m4/modfl.m4 (gl_FUNC_MODFL): Likewise.
* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Likewise.
* m4/perror.m4 (gl_FUNC_PERROR): Likewise.
* m4/popen.m4 (gl_FUNC_POPEN): Likewise.
* m4/posix_spawn.m4 (gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE,
gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2,
gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN): Likewise.
* m4/ptsname_r.m4 (gl_PREREQ_PTSNAME_R): Likewise.
* m4/putenv.m4 (gl_FUNC_PUTENV): Likewise.
* m4/regex.m4 (gl_REGEX): Likewise.
* m4/remainder.m4 (gl_FUNC_REMAINDER): Likewise.
* m4/remainderf.m4 (gl_FUNC_REMAINDERF,
gl_FUNC_REMAINDERF_WORKS): Likewise.
* m4/remainderl.m4 (gl_FUNC_REMAINDERL,
gl_FUNC_REMAINDERL_WORKS): Likewise.
* m4/rename.m4 (gl_FUNC_RENAME): Likewise.
* m4/rmdir-errno.m4 (gl_FUNC_RMDIR_NOTEMPTY): Likewise.
* m4/rmdir.m4 (gl_FUNC_RMDIR): Likewise.
* m4/round.m4 (gl_FUNC_ROUND): Likewise.
* m4/roundf.m4 (gl_FUNC_ROUNDF): Likewise.
* m4/roundl.m4 (gl_FUNC_ROUNDL): Likewise.
* m4/signbit.m4 (gl_SIGNBIT): Likewise.
* m4/sleep.m4 (gl_FUNC_SLEEP): Likewise.
* m4/sqrtl.m4 (gl_FUNC_SQRTL_WORKS): Likewise.
* m4/stdint.m4 (gl_STDINT_H): Likewise.
* m4/strerror.m4 (gl_FUNC_STRERROR_0): Likewise.
* m4/strncat.m4 (gl_FUNC_STRNCAT): Likewise.
* m4/strtod.m4 (gl_FUNC_STRTOD): Likewise.
* m4/strtoimax.m4 (gl_FUNC_STRTOIMAX): Likewise.
* m4/strtok_r.m4 (gl_FUNC_STRTOK_R): Likewise.
* m4/trunc.m4 (gl_FUNC_TRUNC): Likewise.
* m4/truncf.m4 (gl_FUNC_TRUNCF): Likewise.
* m4/truncl.m4 (gl_FUNC_TRUNCL): Likewise.
* m4/tsearch.m4 (gl_FUNC_TSEARCH): Likewise.
* m4/tzset.m4 (gl_FUNC_TZSET_CLOBBER): Likewise.
* m4/ungetc.m4 (gl_FUNC_UNGETC_WORKS): Likewise.
* m4/unlink-busy.m4 (gl_FUNC_UNLINK_BUSY_TEXT): Likewise.
* m4/unlink.m4 (gl_FUNC_UNLINK): Likewise.
* m4/usleep.m4 (gl_FUNC_USLEEP): Likewise.
* m4/utimes.m4 (gl_FUNC_UTIMES): Likewise.
* m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Likewise.
* m4/wcsrtombs.m4 (gl_WCSRTOMBS_TERMINATION, gl_WCSRTOMBS_NULL):
Likewise.
* m4/wctob.m4 (gl_FUNC_WCTOB): Likewise.
* m4/chown.m4 (AC_FUNC_CHOWN): Add cross-compilation guess for native
Windows. Enable also on Autoconf 2.70.
* m4/printf.m4 (gl_PRINTF_SIZES_C99, gl_PRINTF_LONG_DOUBLE,
gl_PRINTF_INFINITE, gl_PRINTF_INFINITE_LONG_DOUBLE,
gl_PRINTF_DIRECTIVE_A, gl_PRINTF_DIRECTIVE_F, gl_PRINTF_DIRECTIVE_N,
gl_PRINTF_DIRECTIVE_LS, gl_PRINTF_FLAG_LEFTADJUST, gl_PRINTF_FLAG_ZERO,
gl_SNPRINTF_TRUNCATION_C99, gl_SNPRINTF_RETVAL_C99,
gl_SNPRINTF_DIRECTIVE_N, gl_SNPRINTF_SIZE1): Add cross-compilation guess
for native Windows.
(gl_PRINTF_POSITIONS, gl_PRINTF_FLAG_GROUPING,
gl_VSNPRINTF_ZEROSIZE_C99): Add comment.

7 years agoImprove cross-compilation guesses for native Windows.
Bruno Haible [Thu, 13 Jul 2017 17:46:33 +0000 (19:46 +0200)]
Improve cross-compilation guesses for native Windows.

* m4/memchr.m4 (gl_FUNC_MEMCHR): Add cross-compilation guess for native
Windows.
* m4/strstr.m4 (gl_FUNC_STRSTR_SIMPLE): Don't use internals of
memchr.m4.
* m4/strcasestr.m4 (gl_FUNC_STRCASESTR_SIMPLE): Likewise.

7 years agoImprove cross-compilation guesses for native Windows.
Bruno Haible [Thu, 13 Jul 2017 17:42:10 +0000 (19:42 +0200)]
Improve cross-compilation guesses for native Windows.

* m4/fflush.m4 (gl_FUNC_FFLUSH_STDIN): Add cross-compilation guess for
native Windows.
(gl_FUNC_FFLUSH): Update accordingly.
* m4/fclose.m4 (gl_FUNC_FCLOSE): Likewise.
* m4/fseeko.m4 (gl_FUNC_FFLUSH_STDIN): Likewise.

7 years agoMore systematic m4 quoting and indentation.
Bruno Haible [Tue, 11 Jul 2017 11:58:01 +0000 (13:58 +0200)]
More systematic m4 quoting and indentation.

* m4/chdir-long.m4 (gl_FUNC_CHDIR_LONG): Quote systematically.
* m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Likewise.
* m4/d-type.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE): Likewise.
* m4/dirfd.m4 (gl_FUNC_DIRFD): Likewise.
* m4/host-os.m4 (gl_HOST_OS): Likewise.
* m4/jm-winsz1.m4 (gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H,
gl_WINSIZE_IN_PTEM): Likewise.
* m4/mbrtowc.m4 (AC_FUNC_MBRTOWC): Likewise.
* m4/physmem.m4 (gl_SYS__SYSTEM_CONFIGURATION): Likewise.
* m4/pselect.m4 (gl_FUNC_PSELECT): Likewise.
* m4/fchownat.m4 (gl_FUNC_FCHOWNAT_DEREF_BUG): Quote systematically.
Correct indentation.
* m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Likewise.
* m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Likewise.
* m4/jm-winsz2.m4 (gl_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL): Likewise.
* m4/rmdir-errno.m4 (gl_FUNC_RMDIR_NOTEMPTY): Likewise.
* m4/tzset.m4 (gl_FUNC_TZSET_CLOBBER): Likewise.
* m4/unlink-busy.m4 (gl_FUNC_UNLINK_BUSY_TEXT): Likewise.

7 years agoround, roundf: Avoid compiler warning in configure test.
Bruno Haible [Tue, 11 Jul 2017 01:52:48 +0000 (03:52 +0200)]
round, roundf: Avoid compiler warning in configure test.

* m4/round.m4 (gl_FUNC_ROUND): Use 'return' instead of exit().
* m4/roundf.m4 (gl_FUNC_ROUNDF): Likewise.

7 years agogetlogin tests: Avoid #ifdefs when sharing code between modules.
Bruno Haible [Mon, 10 Jul 2017 22:53:04 +0000 (00:53 +0200)]
getlogin tests: Avoid #ifdefs when sharing code between modules.

* modules/getlogin_r-tests (Files): Add tests/test-getlogin.h.
* modules/getlogin-tests (Files): Likewise. Remove
tests/test-getlogin_r.c.
* tests/test-getlogin.h: Extracted from tests/test-getlogin_r.c.
* tests/test-getlogin.c: Extracted from tests/test-getlogin_r.c.
* tests/test-getlogin_r.c: Include test-getlogin.h. Omit code that tests
getlogin().

7 years agogetlogin: don’t assume one name per uid
Paul Eggert [Mon, 10 Jul 2017 18:56:48 +0000 (11:56 -0700)]
getlogin: don’t assume one name per uid

Problem reported by Wolfgang F. Muthmann (Bug#27640).
* modules/getlogin-tests (Files): Add tests/test-getlogin_r.c.
(ttyname): Remove test.
* modules/getlogin_r-tests (ttyname): Remove test.
* tests/test-getlogin.c: Replace this near-clone of test-getlogin_r.c
with ‘#define TEST_LOGIN’ followed by ‘#include "test-getlogin_r.c"’.
* tests/test-getlogin_r.c: If TEST_GETLOGIN is defined, test
getlogin rather than getlogin_r.  This avoids code duplication.
(main): Use isatty and fstat rather than ttyname and stat.
Use getpwnam instead of getpwuid, to be portable to test platforms
that have multiple login names for the same uid.

7 years agoglob: Fix more memory leaks.
Tim Rühsen [Mon, 10 Jul 2017 17:02:19 +0000 (19:02 +0200)]
glob: Fix more memory leaks.

* lib/glob.c (glob): Use 'goto out' in order to free dirname before
returning.
Reported by Tim Rühsen.

7 years agoMake sure $host and $host_os are defined when used.
Bruno Haible [Mon, 10 Jul 2017 10:35:06 +0000 (12:35 +0200)]
Make sure $host and $host_os are defined when used.

* m4/argz.m4 (gl_FUNC_ARGZ): Require AC_CANONICAL_HOST.
* m4/closedir.m4 (gl_FUNC_CLOSEDIR): Likewise.
* m4/csharpexec.m4 (gt_CSHARPEXEC): Likewise.
* m4/dirfd.m4 (gl_FUNC_DIRFD): Likewise.
* m4/expl.m4 (gl_FUNC_EXPL): Likewise.
* m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Likewise.
* m4/lstat.m4 (gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): Likewise.
* m4/opendir.m4 (gl_FUNC_OPENDIR): Likewise.
* m4/poll.m4 (gl_FUNC_POLL): Likewise.
* m4/pselect.m4 (gl_FUNC_PSELECT): Likewise.
* m4/ptsname.m4 (gl_FUNC_PTSNAME): Likewise.
* m4/relocatable.m4 (gl_RELOCATABLE_BODY): Likewise.
* m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Likewise.
* m4/ceill.m4 (gl_FUNC_CEILL): Require AC_CANONICAL_HOST outside the
m4_ifdef block.

7 years ago*printf: Fix cross-compilation guess for Solaris.
Bruno Haible [Mon, 10 Jul 2017 00:20:20 +0000 (02:20 +0200)]
*printf: Fix cross-compilation guess for Solaris.

* m4/printf.m4 (gl_PRINTF_DIRECTIVE_F): Fix copy-and-paste mistake from
2010-12-21.

7 years agovasnprintf: port to macOS 10.13
Bruno Haible [Fri, 7 Jul 2017 21:35:32 +0000 (23:35 +0200)]
vasnprintf: port to macOS 10.13

Improve comments in last commit.

7 years agovasnprintf: port to macOS 10.13
Paul Eggert [Fri, 7 Jul 2017 21:10:20 +0000 (14:10 -0700)]
vasnprintf: port to macOS 10.13

Problem reported by comex in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-07/msg00056.html
* lib/vasnprintf.c (VASNPRINTF): Don’t use %n on macOS.

7 years agoimaxdiv tests: Fix logic.
Bruno Haible [Thu, 6 Jul 2017 23:40:07 +0000 (01:40 +0200)]
imaxdiv tests: Fix logic.

* tests/test-imaxdiv.c (main): Use == instead of =.
Reported by Coverity.

7 years agouninorm/filter: Fix use-after-free bug.
Bruno Haible [Thu, 6 Jul 2017 22:14:53 +0000 (00:14 +0200)]
uninorm/filter: Fix use-after-free bug.

* lib/uninorm/uninorm-filter.c (uninorm_filter_write): Maintain
sortbuf == filter->sortbuf invariant.
Reported by Coverity.

7 years agoglob: Fix more memory leaks.
Bruno Haible [Thu, 6 Jul 2017 21:21:49 +0000 (23:21 +0200)]
glob: Fix more memory leaks.

* lib/glob.c (glob): Free dirname before returning.
Reported by Coverity and Tim Rühsen.

7 years agoparse-datetime: fix uninit var bug
Paul Eggert [Thu, 6 Jul 2017 21:08:24 +0000 (14:08 -0700)]
parse-datetime: fix uninit var bug

Reported by Bruno Haible in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-07/msg00038.html
* lib/parse-datetime.y (parse_datetime2): Do not use
uninitialized.

7 years agodoc: Update for MSVC 14.
Bruno Haible [Wed, 5 Jul 2017 23:10:39 +0000 (01:10 +0200)]
doc: Update for MSVC 14.

* doc/posix-headers/*.texi: Add info about MSVC 14.
* doc/posix-functions/*.texi: Likewise.
* doc/pastposix-functions/*.texi: Likewise.
* doc/glibc-headers/*.texi: Likewise.
* doc/glibc-functions/*.texi: Likewise.

7 years agosched: Fix build failure on native Windows (regression from 2017-06-19).
Bruno Haible [Wed, 5 Jul 2017 22:02:32 +0000 (00:02 +0200)]
sched: Fix build failure on native Windows (regression from 2017-06-19).

* m4/sched_h.m4 (gl_SCHED_H): Set HAVE_STRUCT_SCHED_PARAM always.

7 years agoautoupdate
Karl Berry [Wed, 5 Jul 2017 16:03:45 +0000 (09:03 -0700)]
autoupdate

7 years agostdioext: Port to OpenVMS.
John Malmberg [Mon, 3 Jul 2017 13:05:19 +0000 (08:05 -0500)]
stdioext: Port to OpenVMS.

* lib/stdio-impl.h: OpenVMS uses struct _iobuf for FILE information.
* lib/fpending.c (fpending): Remove non-working VMS specific code.
* lib/fbufmode.c (fbufmode): Fix _IOLBF test to use fp_ macro.
* lib/fflush.c (clear_ungetc_buffer): Add OpenVMS to comments.
* lib/fpurge.c (fpurge): Likewise.
* lib/freadable.c (freadable): Likewise.
* lib/freadahead.c (freadahead): Likewise.
* lib/freading.c (freading): Likewise.
* lib/freadptr.c (freadptr): Likewise.
* lib/freadseek.c (freadseek): Likewise.
* lib/fseeko.c (fseeko): Likewise.
* lib/fseterr.c (fseterr): Likewise.
* lib/fwritable.c (fwriteable): Likewise.
* lib/fwriting.c (fwriting): Likewise.

7 years agoglob: Declare variables at the very start of their scope.
Benno Schulenberg [Sat, 1 Jul 2017 16:05:00 +0000 (18:05 +0200)]
glob: Declare variables at the very start of their scope.

* lib/glob.c (convert_dirent, convert_dirent64): Give each fragment
its separate scope, so the functions will compile on Haiku.