agetty: use configured run state directory

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
pull/16/head
Sami Kerola 10 years ago committed by Karel Zak
parent 80c51185d5
commit 01c5b78794
  1. 1
      include/pathnames.h
  2. 3
      term-utils/agetty.c

@ -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"

@ -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)

Loading…
Cancel
Save