[packages/nfs-utils] upstream patch to fix build with glibc 2.42

atler atler at pld-linux.org
Wed Aug 6 18:43:05 CEST 2025


commit 539a11b3350582391c3e3f8265d13f0124e38cbc
Author: Jan Palus <atler at pld-linux.org>
Date:   Wed Aug 6 18:42:32 2025 +0200

    upstream patch to fix build with glibc 2.42

 glibc2.42.patch | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 nfs-utils.spec  |  2 ++
 2 files changed, 57 insertions(+)
---
diff --git a/nfs-utils.spec b/nfs-utils.spec
index 0ecca0d..231e46d 100644
--- a/nfs-utils.spec
+++ b/nfs-utils.spec
@@ -54,6 +54,7 @@ Patch5:		%{name}-x32.patch
 Patch6:		libnfsidmap-pluginpath.patch
 Patch7:		%{name}-sh.patch
 Patch8:		%{name}-krb5-cache.patch
+Patch9:		glibc2.42.patch
 URL:		http://linux-nfs.org/
 BuildRequires:	autoconf >= 2.59
 BuildRequires:	automake
@@ -254,6 +255,7 @@ Statyczna biblioteka libnfsidmap.
 %if %{without krb5}
 %patch -P8 -p1 -R
 %endif
+%patch -P9 -p1
 
 # force regeneration
 %{__rm} tools/nfsrahead/99-nfs.rules
diff --git a/glibc2.42.patch b/glibc2.42.patch
new file mode 100644
index 0000000..25b0b10
--- /dev/null
+++ b/glibc2.42.patch
@@ -0,0 +1,55 @@
+From 9f974046c37b7c28705d5558328759fff708b1cb Mon Sep 17 00:00:00 2001
+From: Yaakov Selkowitz <yselkowi at redhat.com>
+Date: Fri, 27 Jun 2025 04:54:08 -0500
+Subject: [PATCH] Fix build with glibc-2.42
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+exportfs.c: In function ‘release_lockfile’:
+exportfs.c:83:17: error: ignoring return value of ‘lockf’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
+   83 |                 lockf(_lockfd, F_ULOCK, 0);
+      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
+exportfs.c: In function ‘grab_lockfile’:
+exportfs.c:77:17: error: ignoring return value of ‘lockf’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
+   77 |                 lockf(_lockfd, F_LOCK, 0);
+      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
+
+lockf is now marked with attribute warn_unused_result:
+
+https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=f3c82fc1b41261f582f5f9fa12f74af9bcbc88f9
+
+Signed-off-by: Steve Dickson <steved at redhat.com>
+---
+ utils/exportfs/exportfs.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c
+index b03a047..748c38e 100644
+--- a/utils/exportfs/exportfs.c
++++ b/utils/exportfs/exportfs.c
+@@ -74,13 +74,19 @@ grab_lockfile(void)
+ {
+ 	_lockfd = open(lockfile, O_CREAT|O_RDWR, 0666);
+ 	if (_lockfd != -1)
+-		lockf(_lockfd, F_LOCK, 0);
++		if (lockf(_lockfd, F_LOCK, 0) != 0) {
++			xlog_warn("%s: lockf() failed: errno %d (%s)",
++			__func__, errno, strerror(errno));
++		}
+ }
+ static void
+ release_lockfile(void)
+ {
+ 	if (_lockfd != -1) {
+-		lockf(_lockfd, F_ULOCK, 0);
++		if (lockf(_lockfd, F_ULOCK, 0) != 0) {
++			xlog_warn("%s: lockf() failed: errno %d (%s)",
++			__func__, errno, strerror(errno));
++		}
+ 		close(_lockfd);
+ 		_lockfd = -1;
+ 	}
+-- 
+1.8.3.1
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nfs-utils.git/commitdiff/539a11b3350582391c3e3f8265d13f0124e38cbc



More information about the pld-cvs-commit mailing list