glibc/locale/programs
H.J. Lu 5b7c8d1cd4 Always check lockf64 return value
On x86-64, when GCC 14.2.1 is used to build:

commit f3c82fc1b4
Author: Radko Krkos <krkos@mail.muni.cz>
Date:   Sat Jun 14 11:07:40 2025 +0200

    io: Mark lockf() __wur [BZ #32800]

    In commit 0476597b28 flock() was marked __wur in posix/unistd.h, but not
    in io/fcntl.h, the declarations must match.

    Reviewed-by: Florian Weimer <fweimer@redhat.com>

I got

programs/locarchive.c: In function ‘open_archive’:
programs/locarchive.c:641:18: error: ignoring return value of ‘lockf64’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
  641 |           (void) lockf64 (fd, F_ULOCK, sizeof (struct locarhead));
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
programs/locarchive.c:653:14: error: ignoring return value of ‘lockf64’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
  653 |       (void) lockf64 (fd, F_ULOCK, sizeof (struct locarhead));
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
programs/locarchive.c:660:14: error: ignoring return value of ‘lockf64’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
  660 |       (void) lockf64 (fd, F_ULOCK, sizeof (struct locarhead));
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
programs/locarchive.c:679:14: error: ignoring return value of ‘lockf64’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
  679 |       (void) lockf64 (fd, F_ULOCK, sizeof (struct locarhead));
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Update locarchive.c to always check lockf64 return value.  This fixes
BZ #33089.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-06-16 14:48:45 +08:00
..
3level.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
charmap-dir.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
charmap-dir.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
charmap-kw.gperf Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
charmap-kw.h Update copyright dates not handled by scripts/update-copyrights 2025-01-01 11:22:09 -08:00
charmap.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
charmap.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
config.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ld-address.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ld-collate.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ld-ctype.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ld-identification.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ld-measurement.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ld-messages.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ld-monetary.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ld-name.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ld-numeric.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ld-paper.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ld-telephone.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ld-time.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
linereader.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
linereader.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
locale-spec.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
locale.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
localedef.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
localedef.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
locarchive.c Always check lockf64 return value 2025-06-16 14:48:45 +08:00
locfile-kw.gperf Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
locfile-kw.h Update copyright dates not handled by scripts/update-copyrights 2025-01-01 11:22:09 -08:00
locfile-token.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
locfile.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
locfile.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
md5-block.c
md5.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
md5.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
record-status.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
record-status.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
repertoire.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
repertoire.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
simple-hash.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
simple-hash.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
xasprintf.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
xmalloc.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
xstrdup.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00