Skip UTMP/WTMP update on systems w/o support for it (musl)

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-02-14 04:17:39 +01:00
parent d9b705ab98
commit c1e4c24136
+9
View File
@@ -127,6 +127,9 @@ void utmp_logrotate(void)
NULL
};
if (!has_utmp())
return 0;
for (i = 0; files[i]; i++)
logrotate(files[i], MAX_NO, MAX_SZ);
#endif /* LOGROTATE_ENABLED */
@@ -138,6 +141,9 @@ int utmp_set(int type, int pid, char *line, char *id, char *user)
struct utmp ut;
struct utsname uts;
if (!has_utmp())
return 0;
switch (type) {
case RUN_LVL:
case BOOT_TIME:
@@ -188,6 +194,9 @@ static int set_getty(int type, char *tty, char *id, char *user)
{
char *line;
if (!has_utmp())
return 0;
if (!tty)
line = "";
else if (!strncmp(tty, "/dev/", 5))