OSDN Git Service

Allow for better utmp logging.
authorCalin Juravle <calin@google.com>
Tue, 6 May 2014 14:36:02 +0000 (15:36 +0100)
committerCalin Juravle <calin@google.com>
Tue, 6 May 2014 14:44:14 +0000 (15:44 +0100)
Increase (UT_NAMESIZE,UT_LINESIZE,UT_HOSTSIZE) to (32,32,256).

Nobody writes utmp on Android but it would be nice to be aligned
with others who use 32,32,256 (like glibc). If ever used it will produce
nicer logging. There is no consensus in BSDs for these values.

Bug: 14584341
Bug: 12875898

Change-Id: I94af10b982b8f9fcaea897c4cf968563f38403f9

libc/include/utmp.h

index ffd3c92..d764227 100644 (file)
 #define _PATH_WTMP      "/var/log/wtmp"
 #define _PATH_LASTLOG   "/var/log/lastlog"
 
-#define        UT_NAMESIZE     8
-#define        UT_LINESIZE     8
-#define        UT_HOSTSIZE     16
+#ifdef __LP64__
+#define UT_NAMESIZE 32
+#define UT_LINESIZE 32
+#define UT_HOSTSIZE 256
+#else
+#define UT_NAMESIZE 8
+#define UT_LINESIZE 8
+#define UT_HOSTSIZE 16
+#endif
 
 #define USER_PROCESS 7