]> Savannah Git Hosting - gnulib.git/commitdiff
readutmp: Small change to reduce the code size on the coreutils side.
authorBruno Haible <bruno@clisp.org>
Wed, 2 Aug 2023 09:40:35 +0000 (11:40 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 2 Aug 2023 09:40:35 +0000 (11:40 +0200)
* lib/readutmp.h (UT_ID_SIZE): New constant and macro.

ChangeLog
lib/readutmp.h

index e7fd56e6099f1a00457c2ac2e121907060839440..cee07f7cd8decd5b2bf8bf35740e89936f05ceff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-08-02  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        readutmp: Small changes to reduce the code size on the coreutils side.
index 06d2a69daf48bffaf7a17c24628741d4040bc384..d7db9f3a675b935fd34a7a8bbc66ff6daeea2744 100644 (file)
@@ -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 };