diff options
author | Sami Kerola | 2012-06-23 09:02:36 +0200 |
---|---|---|
committer | Karel Zak | 2012-07-10 13:00:20 +0200 |
commit | 01c5b787947aeaffc7e56000827e3edefa357c59 (patch) | |
tree | 710caa16328e883c8f67f0762ee96a3dd459670a | |
parent | uuidd: use run configured state directory (diff) | |
download | kernel-qcow2-util-linux-01c5b787947aeaffc7e56000827e3edefa357c59.tar.gz kernel-qcow2-util-linux-01c5b787947aeaffc7e56000827e3edefa357c59.tar.xz kernel-qcow2-util-linux-01c5b787947aeaffc7e56000827e3edefa357c59.zip |
agetty: use configured run state directory
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rw-r--r-- | include/pathnames.h | 1 | ||||
-rw-r--r-- | term-utils/agetty.c | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/pathnames.h b/include/pathnames.h index ba8de0111..d0ed7a158 100644 --- a/include/pathnames.h +++ b/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" diff --git a/term-utils/agetty.c b/term-utils/agetty.c index 7514015f6..5c445df5b 100644 --- a/term-utils/agetty.c +++ b/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) |