1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-05-13 15:13:36 +00:00
Commit Graph

26873 Commits

Author SHA1 Message Date
Bruno Haible
f8b1b1628b renameatu: Use issymlinkat.
* lib/renameatu.c (renameatu): Use issymlinkat instead of readlinkat.
* modules/renameatu (Depends-on): Remove readlinkat. Add issymlinkat.
2025-08-15 00:23:35 +02:00
Bruno Haible
3dbfcbf5ed rename: Use issymlink.
* lib/rename.c (rpl_rename): Use issymlink instead of readlink.
* modules/rename (Depends-on): Remove readlink. Add issymlink.
2025-08-15 00:23:32 +02:00
Bruno Haible
2f0b2ccec3 fchmodat: Use issymlinkat.
* lib/fchmodat.c (fchmodat): Use issymlinkat instead of readlinkat.
* modules/fchmodat (Depends-on): Add issymlinkat, openat.
2025-08-15 00:23:29 +02:00
Bruno Haible
2a98a9ae33 lchmod: Use issymlink, issymlinkat.
* lib/lchmod.c (lchmod): Use issymlink instead of readlink and
issymlinkat instead of readlinkat.
* modules/lchmod (Depends-on): Remove readlink. Add issymlink,
issymlinkat.
2025-08-15 00:23:27 +02:00
Bruno Haible
64ac89d38d chown: Avoid a redundant stat() call.
* lib/chown.c (rpl_chown): Set stat_valid after stat() succeeded.
2025-08-15 00:23:24 +02:00
Bruno Haible
f478e006d3 lchown: Use issymlink.
* lib/lchown.c (lchown): Use issymlink instead of readlink.
* modules/lchown (Depends-on): Remove readlink. Add issymlink.
2025-08-15 00:23:22 +02:00
Bruno Haible
3cbc197fcf chown: Use issymlink.
* lib/chown.c (rpl_chown): Use issymlink instead of readlink.
* modules/chown (Depends-on): Add issymlink.
2025-08-15 00:23:14 +02:00
Bruno Haible
16db5fb3f0 issymlink, issymlinkat: New modules.
* lib/sys_stat.in.h: Invoke _GL_INLINE_HEADER_BEGIN,
_GL_INLINE_HEADER_END. Include <errno.h>, <unistd.h>.
(_GL_ISSYMLINK_INLINE, _GL_ISSYMLINKAT_INLINE): New macros.
(issymlink, issymlinkat): New declarations.
* lib/unistd.in.h: Do the #include <fcntl.h>, when needed for O_CLOEXEC,
at the end of the file. So that when <fcntl.h> includes <sys/stat.h>,
the declarations of readlink() and readlinkat() on native Windows are
already present.
* lib/issymlink.c: New file.
* lib/issymlinkat.c: New file.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_REQUIRE_DEFAULTS): Initialize
GNULIB_ISSYMLINK, GNULIB_ISSYMLINKAT.
* modules/sys_stat-h (Depends-on): Add extern-inline.
(Makefile.am): Substitute GNULIB_ISSYMLINK, GNULIB_ISSYMLINKAT.
* modules/issymlink: New file.
* modules/issymlinkat: New file.
2025-08-15 00:22:28 +02:00
Paul Eggert
6c0fa77f09 Fix typo in previous change 2025-08-12 09:25:15 -07:00
Paul Eggert
25342d9286 unlinkat: fix another GNU/Hurd typo
Problem reported by Bruno Haible.
* lib/unlinkat.c (rpl_unlinkat): Fix negation.
2025-08-12 08:17:55 -07:00
Paul Eggert
79a205e1cd unlinkat: fix GNU/Hurd typo
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2025-08/msg00041.html
* lib/unlinkat.c (rpl_unlinkat): Declare missing local.
2025-08-11 22:01:14 -07:00
Paul Eggert
1ab2424677 manywarnings: update C warnings for GCC 15.2
This is merely changes to commentary; no changes to
the flags passed to GCC.
* build-aux/gcc-warning.spec: Add warnings introduced in GCC 15.2.
2025-08-11 20:13:08 -07:00
Paul Eggert
64d97a0660 Prefer readlink to lstat+S_ISLNK when easy
To test for a symlink, use readlink, not lstat+S_ISLNK,
when the lstat is used only for the symlink test.
This avoids EOVERFLOW issues.
* lib/lchown.c (rpl_lchown) [CHOWN_CHANGE_TIME_BUG]:
* lib/rename.c (rpl_rename):
[!(_WIN32 && !__CYGWIN__) && (RENAME_TRAILING_SLASH_SOURCE_BUG
|| RENAME_DEST_EXISTS_BUG || RENAME_HARD_LINK_BUG)]:
* lib/renameatu.c (renameatu):
[HAVE_RENAMEAT && RENAME_TRAILING_SLASH_SOURCE_BUG]:
* lib/unlink.c (rpl_unlink):
* lib/unlinkat.c (rpl_unlinkat):
* lib/utimens.c (lutimens) [!HAVE_LUTIMENS]:
Prefer readlink to lstat+S_ISLNK.
* modules/lchown, modules/rename, modules/unlink, modules/utimens:
(Depends-on): Add readlink.
* modules/unlinkat (Depends-on): Add fstatat, readlinkat.
2025-08-11 18:01:37 -07:00
Bruno Haible
b65a8d11a7 nlcanon tests: Fix test failure on Solaris.
* tests/test-nlcanon.sh: Handle the --no-reexec option (from init.sh).
2025-08-11 12:04:17 +02:00
Bruno Haible
0e50f885cd nlcanon: Make it work on OpenBSD.
* build-aux/nlcanon.sh.in (sed_convert_crlf): New variable. Use it
instead of a sed script that contains '\r'.
2025-08-11 11:51:43 +02:00
Bruno Haible
f6afcbccd8 Use standard way of including <config.h>.
* lib/string-desc.c: Use normalized boilerplate.
* lib/string-desc-contains.c: Likewise.
* lib/str_startswith.c: Likewise.
* lib/str_endswith.c: Likewise.
* lib/mbs_endswith.c: Likewise.
2025-08-10 16:35:41 +02:00
Bruno Haible
93a89add7d test-framework-sh: Ensure TESTS_ENVIRONMENT gets augmented in gltests/.
* modules/test-framework-sh (Applicability): New section.
2025-08-10 13:40:48 +02:00
Bruno Haible
352844c641 gnulib-tool: Fix invalid generated Makefile.am (regression 2025-08-04).
* gnulib-tool.sh (func_emit_lib_Makefile_am): Emit line that initializes
TESTS_ENVIRONMENT.
* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Likewise.
2025-08-09 08:17:09 +02:00
Bruno Haible
19b6bc71b0 git-merge-changelog: Remove module.
It is now available through
$ git clone https://git.savannah.gnu.org/git/vc-changelog.git
see https://gitweb.git.savannah.gnu.org/gitweb/?p=vc-changelog.git .

* lib/git-merge-changelog.c: Remove file.
* modules/git-merge-changelog: Remove file.
* NEWS: Mention the change.
2025-08-05 23:20:41 +02:00
Bruno Haible
7e5312beab nlcanon tests: Fix last commit.
* tests/init.sh (setup_): Revert last change.
* modules/test-framework-sh (Makefile.am): Augment TESTS_ENVIRONMENT
here.
* modules/nlcanon-tests (Makefile.am): Don't augment TESTS_ENVIRONMENT
here.
2025-08-05 01:20:58 +02:00
Paul Eggert
9433f4d1a2 vma-iter: pacify Coverity Scan
* lib/vma-iter.c (vma_iterate_procmap_query):
Define only if it could be useful.
2025-08-04 13:23:40 -07:00
Paul Eggert
2027ef8428 dfa: pacify Coverity Scan
* lib/dfa.c (parse_bracket_exp): Omit unnecessary assignments.
2025-08-04 13:23:40 -07:00
Paul Eggert
9967a9c63e * lib/copy-file-range.c: Fix indentation. 2025-08-04 13:23:40 -07:00
Bruno Haible
c7fd199085 nlcanon: Add tests.
* tests/test-nlcanon.sh: New file.
* modules/nlcanon-tests: New file.
* tests/init.sh (setup_): Adjust also top_builddir, if set.
2025-08-04 13:23:54 +02:00
Bruno Haible
ef6e2fcf72 nlcanon: New module.
* build-aux/nlcanon.sh.in: New file, with a function func_tmpdir taken
from build-aux/csharpexec.sh.in.
* modules/nlcanon: New file.
2025-08-04 12:44:14 +02:00
Paul Eggert
2410984b5b Shorten GCC bug URLs 2025-08-02 10:28:08 -07:00
Paul Eggert
9870493709 Shorten glibc bug URLs 2025-08-02 10:28:08 -07:00
Paul Eggert
a44c85a227 More copy_file_range commentary 2025-08-02 08:53:09 -07:00
Collin Funk
c3779ad180 doc: Mention the copy_file_range bug.
* doc/glibc-functions/copy_file_range.texi: Mention glibc bug 33245 in
version 2.41 and 2.42.
2025-08-01 21:34:37 -07:00
Paul Eggert
948ba80168 copy-file-range: work around glibc bug 33245
Problem reported by Leah Neukirchen <https://bugs.gnu.org/79139>.
* lib/copy-file-range.c: Include sys-limits.h.
(copy_file_range) [glibc 2.42 and earlier]:
Copy at most SYS_BUFSIZE_MAX bytes.
* m4/copy-file-range.m4 (gl_FUNC_COPY_FILE_RANGE):
Replace on glibc platforms, as well as on Linux platforms.
* modules/copy-file-range (Files): Add lib/sys-limits.h.
2025-08-01 16:54:42 -07:00
Paul Eggert
626f229915 copy-file-range: tune for more-modern kernels
* lib/copy-file-range.c [__linux__ && HAVE_COPY_FILE_RANGE]:
Include <linux/version.h>.  Include <sys/utsname.h>
only for kernel 5.2 and earlier.
(CHECK_LINUX_KERNEL_VERSION): New macro.
(copy_file_range) [__linux__ && HAVE_COPY_FILE_RANGE]:
Call utsname only when built for kernel 5.2 and earlier.
(copy_file_range) [!__linux__ && HAVE_COPY_FILE_RANGE]:
Use underlying copy_file_range.  This doesn’t change
behavior since the code is not compiled in this case,
but it makes the code a bit cleaner.
* modules/copy-file-range (Depends-on): Add bool.
2025-08-01 16:54:42 -07:00
Bruno Haible
c184b2cd50 sigsegv: Use new ioctl available in Linux >= 6.11.
* lib/stackvma.c: On Linux, include <sys/ioctl.h>, <linux/fs.h>.
(vma_iterate_procmap_query): New function.
(vma_iterate): Try vma_iterate_procmap_query first.
2025-08-01 22:45:19 +02:00
Bruno Haible
cb10832ae9 vma-iter: Use new ioctl available in Linux >= 6.11.
* lib/vma-iter.c: On Linux, include <sys/ioctl.h>, <linux/fs.h>.
(vma_iterate_procmap_query): New function.
(vma_iterate): Try vma_iterate_procmap_query first.
2025-08-01 22:45:19 +02:00
Karl Berry
56c3205a19 autoupdate 2025-08-01 08:11:28 -07:00
Simon Josefsson
6bb58afd0e doc: Improvements for gnulib git bundle.
* doc/gnulib-git-bundle.texi (Gnulib Git Bundle): Add 20250729 release.
Improve reproducibility instructions.
2025-07-31 16:21:30 +02:00
Collin Funk
225973a89f announce-gen: Support all non-deprecated Automake dist formats.
* build-aux/announce-gen (@archive_suffixes): Add tar.bz3, tar.zst, and
zip.
2025-07-29 18:49:42 -07:00
Bruno Haible
ca5ebe4b57 nstrftime: Handle non-Gregorian calendars the same way on all platforms.
Suggested by Collin Funk.

* modules/nstrftime-limited: New file, based on modules/nstrftime.
* modules/nstrftime (Depends-on): Add nstrftime-limited.
Add localename-unsafe. Remove localename-unsafe-limited.
(configure.ac): Invoke gl_MODULE_INDICATOR.
(Makefile.am): Don't add nstrftime.c to lib_SOURCES; this would conflict
with modules/nstrftime-limited.
(Link): Add $(LIBTHREAD).
* lib/strftime.c (SUPPORT_NON_GREG_CALENDARS_IN_STRFTIME): Don't force
to false if GNULIB_NSTRFTIME is defined.
* modules/nstrftime-tests (Makefile.am): Link test-nstrftime,
test-nstrftime-?? with $(LIBTHREAD).
2025-07-29 22:31:13 +02:00
Bruno Haible
287e6b888a git-merge-changelog: Fix upstream/downstream heuristic for "git pull".
* lib/git-merge-changelog.c: Suggest to pass %Y as 4th parameter.
Include <errno.h>, spawn-pipe.h, wait-process.h, xvasprintf.h,
c-ctype.h.
(_): New macro.
(execute_and_read_line): New function, from lib/javacomp.c.
(is_all_hex_digits): New function.
(long_options): Moved into 'main'.
(usage): Document the --debug option.
(main): Accept a --debug option and turn on debugging at runtime instead
of compile-time. Accept an optional other_conflict_label parameter.
Improve 'downstream' determination using two heuristics.
* modules/git-merge-changelog (Depends-on): Add spawn-pipe,
wait-process, xvasprintf, c-ctype.
2025-07-29 16:28:48 +02:00
Bruno Haible
f0773a994e javacomp: Fix memory leak.
* lib/javacomp.c (execute_and_read_line): Free the line after getline()
failed.
2025-07-29 14:29:19 +02:00
Bruno Haible
21b208f43a git-merge-changelog: Fix essential functionality (regr. 2023-05-21).
Fixes two mistakes in commit a8921605af.

Reported by Patrice Dumas <pertusus@free.fr> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-07/msg00181.html>.

* lib/git-merge-changelog.c (main): Fix off-by-one mistakes in crucial
places.
2025-07-29 09:11:40 +02:00
Paul Eggert
1ce8849f3a float-h: change IBM long double to match GCC 15
This is in response to the GCC developers;
see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120993>.
* lib/float.c (gl_LDBL_MAX): Remove the implementation for PowerPC,
as it should no longer be needed.
* lib/float.in.h (LDBL_MIN_EXP, LDBL_MIN_10_EXP, LDBL_MIN)
(LDBL_MAX, LDBL_EPSILON, LDBL_NORM_MAX): On PowerPC with IBM long
double, simplify by using the GCC 15 values unconditionally.
These are the correct values according to the GCC developers
and there seems little point to disagreeing with current GCC
about obsolescent arithmetic that is so problematic in practice.
* tests/test-float-h.c (test_long_double): Relax tests of LDBL_MAX
when !LDBL_IS_IEC_60559, as the tests would now fail on PowerPC and
they were not portable in that case anyway.
2025-07-28 17:53:22 -07:00
Collin Funk
114d91d7c3 posixtm tests: Avoid test failure on Haiku.
* tests/test-posixtm.c (T): On Haiku, disable test cases that would
fail.
2025-07-23 20:54:50 -07:00
Collin Funk
e936bfd8c0 sethostname tests: Avoid test failure on Haiku.
* tests/test-sethostname2.c (main): On Haiku, skip the "too long
hostname" test.
* doc/glibc-functions/sethostname.texi: Mention the Haiku problem.
2025-07-23 19:55:41 -07:00
Bruno Haible
516d94893d run-test: Suggest a more reliable way of invoking valgrind.
* build-aux/run-test (func_usage): Suggest to use the --error-exitcode
option.
2025-07-23 09:32:25 +02:00
Bruno Haible
49a35c02d2 thrd: Avoid conversion between different function pointer types.
Reported by Collin Funk in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-07/msg00170.html>.

* m4/thrd.m4 (gl_FUNC_THRD_JOIN): Define BROKEN_THRD_START_T or
BROKEN_THRD_JOIN. Don't define BROKEN_THRD_START_T_OR_JOIN.
* lib/thrd.c (thrd_main_func): Define with the right return type,
depending on BROKEN_THRD_START_T.
2025-07-23 09:12:55 +02:00
Paul Eggert
1f4148c157 fsync, fdatasync: generalize fsync write access doc 2025-07-22 15:37:22 -07:00
Collin Funk
7075f23775 doc: Document that fsync doesn't work on directories on AIX 7.3.
Reported by Lakshmi-Surekha <Lakshmi.Kovvuri@ibm.com> in:
<https://github.com/tukaani-project/xz/issues/188>.

* doc/posix-functions/fsync.texi: Document the behavior.
2025-07-22 14:40:50 -07:00
Paul Eggert
84ddfc7bd2 mkdir-p: ENOENT/ENOTDIR safety and consistency
* lib/mkdir-p.c (make_dir_parents): If mkdir fails with ENOENT or
ENOTDIR, do not attempt anything else since the file does not exist.
Treat ENOENT and ENOTDIR consistently later, too.
2025-07-22 12:14:04 -07:00
Paul Eggert
27db579667 mkdir-p: better diagnostics
Problem reported by Lauri Tirkkonen <https://bugs.gnu.org/79072>.
* lib/mkdir-p.c (make_dir_parents):
If savewd_chdir fails due to anything other than EACCES, do
not attempt to preserve permissions; instead, fail with mkdir’s
errno if nonzero, and with savewd_chdir’s errno otherwise.
2025-07-22 12:14:04 -07:00
Collin Funk
f07c45598e sys_un-h: Make sure that the 'sys' subdirectory is created.
* modules/sys_un-h (Makefile.am): Make the 'sys' subdirectory. Remove
@NMD@ that is not applicable to subdirectories.
2025-07-21 19:04:09 -07:00