From: Khem Raj Date: Tue, 29 Jul 2025 05:37:13 +0000 (-0700) Subject: nfs-utils: Fix build with glibc 2.42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f968715a1577939bdf9fd99006ca44aaf9c7a9d;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git nfs-utils: Fix build with glibc 2.42 Signed-off-by: Khem Raj Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0002-Fix-build-with-glibc-2.42.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0002-Fix-build-with-glibc-2.42.patch new file mode 100644 index 0000000000..0b22511873 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0002-Fix-build-with-glibc-2.42.patch @@ -0,0 +1,57 @@ +From d74ef9afacf9dc4a067a2f984f52ad136fb46c31 Mon Sep 17 00:00:00 2001 +From: Yaakov Selkowitz +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=UTF-8 +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 + +Upstream-Status: Backport [https://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=9f974046c37b7c28705d5558328759fff708b1cb] +Signed-off-by: Steve Dickson +Signed-off-by: Khem Raj +--- + 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; + } +-- +2.43.0 + diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.3.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.3.bb index 9668ac0e86..a2afe2cd15 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.3.bb +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.3.bb @@ -22,6 +22,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x file://nfsserver \ file://nfscommon \ file://0001-locktest-Makefile.am-Do-not-use-build-flags.patch \ + file://0002-Fix-build-with-glibc-2.42.patch \ file://0004-Use-nogroup-for-nobody-group.patch \ file://0005-find-OE-provided-Kerberos.patch \ "