summaryrefslogtreecommitdiff
path: root/user/physlock/utmps.patch
blob: f3ba5e575bfe6fbfb3a97b664bc9f8e05d5f5900 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- physlock-13/session.c	2019-01-28 18:46:20.000000000 +0000
+++ physlock-13/session.c	2019-04-18 07:11:54.749911535 +0000
@@ -6,7 +7,7 @@
 #include <pwd.h>
 #include <unistd.h>
 #include <errno.h>
-#include <utmp.h>
+#include <utmpx.h>
 
 #if HAVE_SYSTEMD
 #include <systemd/sd-login.h>
@@ -50,11 +51,11 @@
 int get_user_utmp(userinfo_t *uinfo, int vt) {
 	int ret = -1;
 	FILE *uf;
-	struct utmp r;
+	struct utmpx r;
 	char tty[UT_LINESIZE+1], name[UT_NAMESIZE+1];
 
 	name[0] = '\0';
-	while ((uf = fopen(_PATH_UTMP, "r")) == NULL && errno == EINTR);
+	while ((uf = fopen(UTMPX_FILE, "r")) == NULL && errno == EINTR);
 
 	if (uf != NULL) {
 		snprintf(tty, sizeof(tty), "tty%d", vt);