Skip UTMP/WTMP update on systems w/o support for it (musl)
@@ -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))
