From: Bruno Haible Date: Tue, 8 Aug 2023 15:23:24 +0000 (+0200) Subject: readutmp: Fix compilation error on OpenBSD (regr. 2023-08-02). X-Git-Tag: v1.0~954 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=4dabfced553a42fbd1012a8b839a5ef26100a276;p=gnulib.git readutmp: Fix compilation error on OpenBSD (regr. 2023-08-02). * lib/readutmp.h (UT_ID_SIZE): Define to a dummy if there is no ut_id field. --- diff --git a/ChangeLog b/ChangeLog index 25d90019da..21886433f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2023-08-08 Bruno Haible + + readutmp: Fix compilation error on OpenBSD (regr. 2023-08-02). + * lib/readutmp.h (UT_ID_SIZE): Define to a dummy if there is no ut_id + field. + 2023-08-07 Paul Eggert quotearg: fix obsolete comment diff --git a/lib/readutmp.h b/lib/readutmp.h index 01964d2622..9f53246597 100644 --- a/lib/readutmp.h +++ b/lib/readutmp.h @@ -213,7 +213,11 @@ enum { UT_USER_SIZE = sizeof UT_USER ((STRUCT_UTMP *) 0) }; #if HAVE_GL_UTMP enum { UT_ID_SIZE = -1 }; #else +# if (HAVE_UTMPX_H ? HAVE_STRUCT_UTMPX_UT_ID : HAVE_STRUCT_UTMP_UT_ID) enum { UT_ID_SIZE = sizeof (((STRUCT_UTMP *) 0)->ut_id) }; +# else +enum { UT_ID_SIZE = 1 }; +# endif # define UT_ID_SIZE UT_ID_SIZE #endif