projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libbb: introduce and use xgetpwnam. ~ -150 bytes.
[oweals/busybox.git]
/
loginutils
/
vlock.c
diff --git
a/loginutils/vlock.c
b/loginutils/vlock.c
index 42ef447326baca7d951963e924f3ea3442e4e49a..85f489c2286d1b5574e5a339139be1941c7fb391 100644
(file)
--- a/
loginutils/vlock.c
+++ b/
loginutils/vlock.c
@@
-38,14
+38,9
@@
int vlock_main(int argc UNUSED_PARAM, char **argv)
struct termios term;
struct termios oterm;
struct vt_mode ovtm;
struct termios term;
struct termios oterm;
struct vt_mode ovtm;
- uid_t uid;
struct passwd *pw;
struct passwd *pw;
-/* XXX: xgetpwuid */
- uid = getuid();
- pw = getpwuid(uid);
- if (pw == NULL)
- bb_error_msg_and_die("unknown uid %d", (int)uid);
+ pw = xgetpwuid(getuid());
opt_complementary = "=0"; /* no params! */
getopt32(argv, "a");
opt_complementary = "=0"; /* no params! */
getopt32(argv, "a");
@@
-87,7
+82,7
@@
int vlock_main(int argc UNUSED_PARAM, char **argv)
term.c_iflag |= IGNBRK;
term.c_lflag &= ~ISIG;
term.c_lflag &= ~(ECHO | ECHOCTL);
term.c_iflag |= IGNBRK;
term.c_lflag &= ~ISIG;
term.c_lflag &= ~(ECHO | ECHOCTL);
- tcsetattr
(STDIN_FILENO, TCSANOW,
&term);
+ tcsetattr
_stdin_TCSANOW(
&term);
do {
printf("Virtual console%s locked by %s.\n",
do {
printf("Virtual console%s locked by %s.\n",
@@
-101,6
+96,6
@@
int vlock_main(int argc UNUSED_PARAM, char **argv)
} while (1);
ioctl(STDIN_FILENO, VT_SETMODE, &ovtm);
} while (1);
ioctl(STDIN_FILENO, VT_SETMODE, &ovtm);
- tcsetattr
(STDIN_FILENO, TCSANOW,
&oterm);
+ tcsetattr
_stdin_TCSANOW(
&oterm);
fflush_stdout_and_exit(EXIT_SUCCESS);
}
fflush_stdout_and_exit(EXIT_SUCCESS);
}