glibc/locale
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
..
bits Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
programs Always check lockf64 return value 2025-06-16 14:48:45 +08:00
tst-localedef-path-norm.root localedef: Add verbose messages for failure paths. 2020-04-26 13:55:58 -04:00
C-address.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
C-collate-seq.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
C-collate.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
C-ctype.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
C-identification.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
C-measurement.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
C-messages.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
C-monetary.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
C-name.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
C-numeric.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
C-paper.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
C-telephone.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
C-time.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
C-translit.h.in Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
C_name.c
Makefile Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
SYS_libc.c
Versions C2x strtol binary constant handling 2023-02-16 23:02:40 +00:00
broken_cur_max.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
categories.def Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
coll-lookup.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
coll-lookup.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
duplocale.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
elem-hash.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
findlocale.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
freelocale.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
gen-translit.py Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
global-locale.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
hashval.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
indigits.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
indigitswc.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
iso-639.def Define ISO 639-3 "ltg" (Latgalian) and add ltg_LV locale 2024-06-17 10:53:16 +02:00
iso-3166.def localedata: Use the name North Macedonia. 2025-06-04 12:01:55 +02:00
iso-4217.def localedata: Refer to Eswatini instead of Swaziland. 2025-06-03 10:53:12 +02:00
langinfo.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
lc-address.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
lc-collate.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
lc-ctype.c Remove <libc-tsd.h> 2025-05-16 19:53:09 +02:00
lc-identification.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
lc-measurement.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
lc-messages.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
lc-monetary.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
lc-name.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
lc-numeric.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
lc-paper.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
lc-telephone.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
lc-time.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
loadarchive.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
loadlocale.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
locale.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
localeconv.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
localeinfo.h Optimize __libc_tsd_* thread variable access 2025-05-16 19:53:09 +02:00
localename.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
locarchive.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
mb_cur_max.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
newlocale.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
nl_langinfo.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
nl_langinfo_l.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
outdigits.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
outdigitswc.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
setlocale.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
strlen-hash.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-C-locale.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-duplocale.c
tst-locale-locpath.sh Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-localedef-path-norm.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-locname.c
uselocale.c Remove <libc-tsd.h> 2025-05-16 19:53:09 +02:00
weight.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
weightwc.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
xlocale.c Use proper extern declaration for _nl_C_LC_CTYPE_{class,toupper,tolower} 2025-05-16 19:53:09 +02:00