agetty: use configured run state directory
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
80c51185d5
commit
01c5b78794
|
@ -63,6 +63,7 @@
|
||||||
|
|
||||||
/* used in term-utils/agetty.c */
|
/* used in term-utils/agetty.c */
|
||||||
#define _PATH_ISSUE "/etc/issue"
|
#define _PATH_ISSUE "/etc/issue"
|
||||||
|
#define _PATH_NUMLOCK_ON _PATH_LOCALSTATEDIR "/numlock-on"
|
||||||
|
|
||||||
#define _PATH_LOGINDEFS "/etc/login.defs"
|
#define _PATH_LOGINDEFS "/etc/login.defs"
|
||||||
|
|
||||||
|
|
|
@ -1259,9 +1259,8 @@ static void do_prompt(struct options *op, struct termios *tp)
|
||||||
if (ioctl(STDIN_FILENO, KDGKBLED, &kb) == 0) {
|
if (ioctl(STDIN_FILENO, KDGKBLED, &kb) == 0) {
|
||||||
char hint[256] = { '\0' };
|
char hint[256] = { '\0' };
|
||||||
int nl = 0;
|
int nl = 0;
|
||||||
struct stat st;
|
|
||||||
|
|
||||||
if (stat("/var/run/numlock-on", &st) == 0)
|
if (access(_PATH_NUMLOCK_ON, F_OK) == 0)
|
||||||
nl = 1;
|
nl = 1;
|
||||||
|
|
||||||
if (nl && (kb & 0x02) == 0)
|
if (nl && (kb & 0x02) == 0)
|
||||||
|
|
Loading…
Reference in New Issue