From e9a89248ecad4a9e58ba9b98d5f34352a6705bba Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 14 Feb 2021 04:30:27 +0100 Subject: [PATCH] Minor refactor Signed-off-by: Joachim Wiberg --- src/utmp-api.c | 10 +++------- src/utmp-api.h | 7 +++++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/utmp-api.c b/src/utmp-api.c index a3051a45..b70ea602 100644 --- a/src/utmp-api.c +++ b/src/utmp-api.c @@ -23,18 +23,14 @@ #include "config.h" -#include #include -#include #include #include #include #include "helpers.h" - -#ifndef _PATH_BTMP -#define _PATH_BTMP "/var/log/btmp" -#endif +#include "util.h" +#include "utmp-api.h" #define MAX_NO 5 #define MAX_SZ 100 * 1024 @@ -128,7 +124,7 @@ void utmp_logrotate(void) }; if (!has_utmp()) - return 0; + return; for (i = 0; files[i]; i++) logrotate(files[i], MAX_NO, MAX_SZ); diff --git a/src/utmp-api.h b/src/utmp-api.h index 20f67cf7..f3ddfd39 100644 --- a/src/utmp-api.h +++ b/src/utmp-api.h @@ -24,6 +24,13 @@ #ifndef FINIT_UTMP_API_H_ #define FINIT_UTMP_API_H_ +#include +#include + +#ifndef _PATH_BTMP +#define _PATH_BTMP "/var/log/btmp" +#endif + int utmp_set (int type, int pid, char *line, char *id, char *user); int utmp_set_boot (void); int utmp_set_halt (void);