On 2025-01-08 Paul Eggert wrote:
> On 2025-01-07 10:22, Lasse Collin wrote:
> 
> > However, one thing that isn't an issue in musl is fchmod which is
> > currently documented in Gnulib's doc/posix-headers/fcntl.texi.
> > fchmod and a few others were fixed in 2013 by using
> > /proc/self/fd.[1]  
> 
> Is that a full fix, though? /proc might not be mounted.

No, it requires /proc, but it works most of the time...

> > It could be useful to add a test for gzip --synchronous.  
> 
> Feel free....

Attached. It's based on z-suffix.

-- 
Lasse Collin
From 863735bf556a4f82f78b1dd5a4b8081d2ffa0b41 Mon Sep 17 00:00:00 2001
From: Lasse Collin <lasse.col...@tukaani.org>
Date: Wed, 8 Jan 2025 12:19:21 +0200
Subject: [PATCH] tests: synchronous: new test

* tests/synchronous: Test that --synchronous works. This
failed with musl 1.2.5 before the Gnulib commit 0fb185b7cd5e
("fcntl-h: port better to musl on GNU/Linux").
* tests/Makefile.am (TESTS): Add it.
---
 tests/Makefile.am |  1 +
 tests/synchronous | 30 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100755 tests/synchronous

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4c10a71..d86cfb0 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -29,6 +29,7 @@ TESTS =					\
   pipe-output				\
   reproducible				\
   stdin					\
+  synchronous				\
   timestamp				\
   two-files				\
   trailing-nul				\
diff --git a/tests/synchronous b/tests/synchronous
new file mode 100755
index 0000000..9261c9e
--- /dev/null
+++ b/tests/synchronous
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Check that --synchronous works.
+
+# Copyright 2014-2025 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+# limit so don't run it by default.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ..
+
+printf anything > F || framework_failure_
+gzip --synchronous F || fail=1
+test ! -f F || fail=1
+test -f F.gz || fail=1
+gzip -d --synchronous F.gz || fail=1
+test ! -f F.gz || fail=1
+test -f F || fail=1
+
+Exit $fail
-- 
2.47.1

Reply via email to