mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user