mirror of
https://github.com/troglobit/finit.git
synced 2026-10-31 13:00:32 +00:00
Workaround for _PATH_UTMP and _PATH_WTMP defines on musl libc
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
5fbcf6814c
commit
8a71f2d323
3 files changed
+20
-6
No files matched your search
+1
-1
@@ -31,7 +31,6 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <utmp.h>
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <lite/lite.h>
|
#include <lite/lite.h>
|
||||||
|
|
||||||
@@ -40,6 +39,7 @@
|
|||||||
#include "serv.h"
|
#include "serv.h"
|
||||||
#include "service.h"
|
#include "service.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "utmp-api.h"
|
||||||
|
|
||||||
#define _PATH_COND _PATH_VARRUN "finit/cond/"
|
#define _PATH_COND _PATH_VARRUN "finit/cond/"
|
||||||
|
|
||||||
|
|||||||
+1
-5
@@ -25,16 +25,12 @@
|
|||||||
|
|
||||||
#include <paths.h>
|
#include <paths.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <utmp.h>
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <lite/lite.h>
|
#include <lite/lite.h>
|
||||||
|
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
#include "utmp-api.h"
|
||||||
#ifndef _PATH_BTMP
|
|
||||||
#define _PATH_BTMP "/var/log/btmp"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MAX_NO 5
|
#define MAX_NO 5
|
||||||
#define MAX_SZ 100 * 1024
|
#define MAX_SZ 100 * 1024
|
||||||
|
|||||||
@@ -24,6 +24,24 @@
|
|||||||
#ifndef FINIT_UTMP_API_H_
|
#ifndef FINIT_UTMP_API_H_
|
||||||
#define FINIT_UTMP_API_H_
|
#define FINIT_UTMP_API_H_
|
||||||
|
|
||||||
|
#include <utmp.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* musl libc default to /dev/null/utmp and /dev/null/wtmp, respectively.
|
||||||
|
* See https://www.openwall.com/lists/musl/2012/03/04/4 for reasoning.
|
||||||
|
*
|
||||||
|
* Also, there's no __MUSL__, so we cannot make a libc-specific check
|
||||||
|
* here to work around this, that's why everyone pays.
|
||||||
|
*/
|
||||||
|
#undef _PATH_UTMP
|
||||||
|
#undef _PATH_WTMP
|
||||||
|
#undef _PATH_BTMP
|
||||||
|
|
||||||
|
#define _PATH_UTMP "/var/run/wtmp"
|
||||||
|
#define _PATH_WTMP "/var/log/wtmp"
|
||||||
|
#define _PATH_BTMP "/var/log/btmp"
|
||||||
|
|
||||||
|
|
||||||
int utmp_set (int type, int pid, char *line, char *id, char *user);
|
int utmp_set (int type, int pid, char *line, char *id, char *user);
|
||||||
int utmp_set_boot (void);
|
int utmp_set_boot (void);
|
||||||
int utmp_set_halt (void);
|
int utmp_set_halt (void);
|
||||||
|
|||||||
Reference in new issue
Block a user