xfunc: fix: && -> &. Also nuked two double semicolons...
[oweals/busybox.git] / loginutils / vlock.c
index 0975b515678770c8a5226c2f44bc0bb625ffd1ff..b4426ad41a607be9fe23d676f0a026c8370d339c 100644 (file)
@@ -1,24 +1,12 @@
 /* vi: set sw=4 ts=4: */
+
 /*
  * vlock implementation for busybox
  *
  * Copyright (C) 2000 by spoon <spoon@ix.netcom.com>
  * Written by spoon <spon@ix.netcom.com>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  */
 
 /* Shoutz to Michael K. Johnson <johnsonm@redhat.com>, author of the
 /* Fixed by Erik Andersen to do passwords the tinylogin way...
  * It now works with md5, sha1, etc passwords. */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/vt.h>
-#include <signal.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <termios.h>
-
 #include "busybox.h"
+#include <sys/vt.h>
 
 static struct passwd *pw;
 static struct vt_mode ovtm;
@@ -66,7 +44,7 @@ static void restore_terminal(void)
        tcsetattr(STDIN_FILENO, TCSANOW, &oterm);
 }
 
-extern int vlock_main(int argc, char **argv)
+int vlock_main(int argc, char **argv)
 {
        sigset_t sig;
        struct sigaction sa;
@@ -83,7 +61,7 @@ extern int vlock_main(int argc, char **argv)
                bb_error_msg_and_die("Unknown uid %d", getuid());
        }
 
-       vfd = bb_xopen(CURRENT_TTY, O_RDWR);
+       vfd = xopen(CURRENT_TTY, O_RDWR);
 
        if (ioctl(vfd, VT_GETMODE, &vtm) < 0) {
                bb_perror_msg_and_die("VT_GETMODE");
@@ -141,11 +119,3 @@ extern int vlock_main(int argc, char **argv)
        restore_terminal();
        return 0;
 }
-
-/*
-Local Variables:
-c-file-style: "linux"
-c-basic-offset: 4
-tab-width: 4
-End:
-*/