From: Bruno Haible Date: Wed, 2 Aug 2023 09:40:35 +0000 (+0200) Subject: readutmp: Small change to reduce the code size on the coreutils side. X-Git-Tag: v1.0~980 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=a48bcaa93fc27a20c537bfc949c84739a090745b;p=gnulib.git readutmp: Small change to reduce the code size on the coreutils side. * lib/readutmp.h (UT_ID_SIZE): New constant and macro. --- diff --git a/ChangeLog b/ChangeLog index e7fd56e609..cee07f7cd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2023-08-02 Bruno Haible + + readutmp: Small change to reduce the code size on the coreutils side. + * lib/readutmp.h (UT_ID_SIZE): New constant and macro. + 2023-08-01 Bruno Haible readutmp: Small changes to reduce the code size on the coreutils side. diff --git a/lib/readutmp.h b/lib/readutmp.h index 06d2a69daf..d7db9f3a67 100644 --- a/lib/readutmp.h +++ b/lib/readutmp.h @@ -271,6 +271,14 @@ enum { UT_USER_SIZE = sizeof UT_USER ((STRUCT_UTMP *) 0) }; # define UT_USER_SIZE UT_USER_SIZE # endif +/* Size of the ut->ut_id member, or -1 if unbounded. */ +# if READUTMP_USE_SYSTEMD +enum { UT_ID_SIZE = -1 }; +# else +enum { UT_ID_SIZE = sizeof (((STRUCT_UTMP *) 0)->ut_id) }; +# define UT_ID_SIZE UT_ID_SIZE +# endif + /* Size of the ut->ut_line member, or -1 if unbounded. */ # if READUTMP_USE_SYSTEMD enum { UT_LINE_SIZE = -1 };