From: Steve Dickson <steved@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] Fix build with glibc-2.42
Date: Fri, 27 Jun 2025 06:44:01 -0400 [thread overview]
Message-ID: <e007eaf1-ff4b-4271-9ff4-82404b6e4688@redhat.com> (raw)
In-Reply-To: <20250627100658.102342-1-steved@redhat.com>
On 6/27/25 6:06 AM, Steve Dickson wrote:
> From: Yaakov Selkowitz <yselkowi@redhat.com>
>
> 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@redhat.com>
Committed... (tag: nfs-utils-2-8-4-rc3)
steved.
> ---
> 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 b03a047b..748c38e3 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;
> }
prev parent reply other threads:[~2025-06-27 10:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 10:06 [PATCH] Fix build with glibc-2.42 Steve Dickson
2025-06-27 10:44 ` Steve Dickson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e007eaf1-ff4b-4271-9ff4-82404b6e4688@redhat.com \
--to=steved@redhat.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox