]> Savannah Git Hosting - gnulib.git/commitdiff
readutmp, boot-time: Don't use __UT_* symbols (regression 2023-08-11).
authorBruno Haible <bruno@clisp.org>
Mon, 14 Aug 2023 13:47:41 +0000 (15:47 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 14 Aug 2023 13:47:41 +0000 (15:47 +0200)
* lib/readutmp.h (_GL_UT_USER_SIZE, _GL_UT_ID_SIZE, _GL_UT_LINE_SIZE,
_GL_UT_HOST_SIZE): New macros.
(struct utmpx32): Use them.

ChangeLog
lib/readutmp.h

index 76d95bebaf064dd5e0e61b53ca1f935332a761f4..f386e9a579633351996d6486a22391de3a655e47 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-08-14  Bruno Haible  <bruno@clisp.org>
+
+       readutmp, boot-time: Don't use __UT_* symbols (regression 2023-08-11).
+       * lib/readutmp.h (_GL_UT_USER_SIZE, _GL_UT_ID_SIZE, _GL_UT_LINE_SIZE,
+       _GL_UT_HOST_SIZE): New macros.
+       (struct utmpx32): Use them.
+
 2023-08-14  Bruno Haible  <bruno@clisp.org>
 
        readutmp, boot-time: Fix build on 32-bit glibc (regression 2023-08-11).
index 1fbe29d86fb56726961f04f0a86f3f6c21217bfb..3ddecf3727228974e28ad5d760fa63d809ecf045 100644 (file)
@@ -136,14 +136,18 @@ enum { UT_HOST_SIZE = -1 };
 /* This is a near-copy of glibc's struct utmpx, which stops working
    after the year 2038.  Unlike the glibc version, struct utmpx32
    describes the file format even if time_t is 64 bits.  */
+#define _GL_UT_USER_SIZE  sizeof (((struct utmpx *) 0)->ut_user)
+#define _GL_UT_ID_SIZE    sizeof (((struct utmpx *) 0)->ut_id)
+#define _GL_UT_LINE_SIZE  sizeof (((struct utmpx *) 0)->ut_line)
+#define _GL_UT_HOST_SIZE  sizeof (((struct utmpx *) 0)->ut_host)
 struct utmpx32
 {
   short int ut_type;               /* Type of login.  */
   pid_t ut_pid;                    /* Process ID of login process.  */
-  char ut_line[__UT_LINESIZE];     /* Devicename.  */
-  char ut_id[4];                   /* Inittab ID.  */
-  char ut_user[__UT_NAMESIZE];     /* Username.  */
-  char ut_host[__UT_HOSTSIZE];     /* Hostname for remote login. */
+  char ut_line[_GL_UT_LINE_SIZE];  /* Devicename.  */
+  char ut_id[_GL_UT_ID_SIZE];      /* Inittab ID.  */
+  char ut_user[_GL_UT_USER_SIZE];  /* Username.  */
+  char ut_host[_GL_UT_HOST_SIZE];  /* Hostname for remote login. */
   struct __exit_status ut_exit;    /* Exit status of a process marked
                                       as DEAD_PROCESS.  */
   /* The fields ut_session and ut_tv must be the same size when compiled