From a48bcaa93fc27a20c537bfc949c84739a090745b Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 2 Aug 2023 11:40:35 +0200 Subject: [PATCH] readutmp: Small change to reduce the code size on the coreutils side. * lib/readutmp.h (UT_ID_SIZE): New constant and macro. --- ChangeLog | 5 +++++ lib/readutmp.h | 8 ++++++++ 2 files changed, 13 insertions(+) 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 }; -- 2.39.5