Skip to content
Browse files

agetty: use configured run state directory

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
  • Loading branch information...
1 parent 80c5118 commit 01c5b787947aeaffc7e56000827e3edefa357c59 @kerolasa kerolasa committed with Jun 23, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −0 include/pathnames.h
  2. +1 −2 term-utils/agetty.c
View
1 include/pathnames.h
@@ -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
3 term-utils/agetty.c
@@ -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)

0 comments on commit 01c5b78

Please sign in to comment.
Something went wrong with that request. Please try again.