mirror of git://git.suckless.org/sbase
Use /var/run/utmp for now
Musl-libc seems to define that to /dev/null/utmp
This commit is contained in:
parent
713f1cfdb2
commit
450f930c17
2
uptime.c
2
uptime.c
|
@ -46,7 +46,7 @@ main(int argc, char *argv[])
|
||||||
else
|
else
|
||||||
printf("%d min, ", minutes);
|
printf("%d min, ", minutes);
|
||||||
|
|
||||||
if ((ufp = fopen(_PATH_UTMP, "r"))) {
|
if ((ufp = fopen("/var/run/utmp", "r"))) {
|
||||||
while(fread(&usr, sizeof(usr), 1, ufp) == 1) {
|
while(fread(&usr, sizeof(usr), 1, ufp) == 1) {
|
||||||
if (!*usr.ut_name || !*usr.ut_line ||
|
if (!*usr.ut_name || !*usr.ut_line ||
|
||||||
usr.ut_line[0] == '~')
|
usr.ut_line[0] == '~')
|
||||||
|
|
Loading…
Reference in New Issue