agetty: use configured run state directory

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2012-06-23 09:02:36 +02:00 committed by Karel Zak
parent 80c51185d5
commit 01c5b78794
2 changed files with 2 additions and 2 deletions

View File

@ -63,6 +63,7 @@
/* used in term-utils/agetty.c */
#define _PATH_ISSUE "/etc/issue"
#define _PATH_NUMLOCK_ON _PATH_LOCALSTATEDIR "/numlock-on"
#define _PATH_LOGINDEFS "/etc/login.defs"

View File

@ -1259,9 +1259,8 @@ static void do_prompt(struct options *op, struct termios *tp)
if (ioctl(STDIN_FILENO, KDGKBLED, &kb) == 0) {
char hint[256] = { '\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;
if (nl && (kb & 0x02) == 0)