svn commit: trunk/busybox/loginutils
aldot at busybox.net
aldot at busybox.net
Mon Nov 27 13:58:19 UTC 2006
Author: aldot
Date: 2006-11-27 05:58:18 -0800 (Mon, 27 Nov 2006)
New Revision: 16683
Log:
- minor shrinkage
text data bss dec hex filename
773 0 80 853 355 vlock.o.orig
766 0 80 846 34e vlock.o
Modified:
trunk/busybox/loginutils/vlock.c
Changeset:
Modified: trunk/busybox/loginutils/vlock.c
===================================================================
--- trunk/busybox/loginutils/vlock.c 2006-11-27 10:03:21 UTC (rev 16682)
+++ trunk/busybox/loginutils/vlock.c 2006-11-27 13:58:18 UTC (rev 16683)
@@ -27,10 +27,7 @@
static void release_vt(int signo)
{
- if (!o_lock_all)
- ioctl(vfd, VT_RELDISP, 1);
- else
- ioctl(vfd, VT_RELDISP, 0);
+ ioctl(vfd, VT_RELDISP, !o_lock_all);
}
static void acquire_vt(int signo)
@@ -50,17 +47,18 @@
struct sigaction sa;
struct vt_mode vtm;
struct termios term;
+ uid_t uid = getuid();
+ pw = getpwuid(uid);
+ if (pw == NULL)
+ bb_error_msg_and_die("unknown uid %d", uid);
+
if (argc > 2) {
bb_show_usage();
}
o_lock_all = getopt32(argc, argv, "a");
- if((pw = getpwuid(getuid())) == NULL) {
- bb_error_msg_and_die("unknown uid %d", getuid());
- }
-
vfd = xopen(CURRENT_TTY, O_RDWR);
if (ioctl(vfd, VT_GETMODE, &vtm) < 0) {
More information about the busybox-cvs
mailing list