aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-10-22 10:34:15 +0000
committerEric Andersen <andersen@codepoet.org>2003-10-22 10:34:15 +0000
commit7f6295f51604a97a61958909b652dcf1e0e49485 (patch)
treed54b03624a9f7076e96f6b8d1897a0a7b5db76d5
parent28672dd3b9ff9d27c771f011089e38a2928aded7 (diff)
downloadbusybox-w32-7f6295f51604a97a61958909b652dcf1e0e49485.tar.gz
busybox-w32-7f6295f51604a97a61958909b652dcf1e0e49485.tar.bz2
busybox-w32-7f6295f51604a97a61958909b652dcf1e0e49485.zip
Patch from Arthur Othieno for style-guide.txt conformance
-rw-r--r--console-tools/clear.c2
-rw-r--r--console-tools/deallocvt.c40
-rw-r--r--console-tools/reset.c6
3 files changed, 36 insertions, 12 deletions
diff --git a/console-tools/clear.c b/console-tools/clear.c
index 5dbe214ea..45976e1b5 100644
--- a/console-tools/clear.c
+++ b/console-tools/clear.c
@@ -20,6 +20,8 @@
20 * 20 *
21 */ 21 */
22 22
23/* no options, no getopt */
24
23#include <stdio.h> 25#include <stdio.h>
24#include <stdlib.h> 26#include <stdlib.h>
25#include "busybox.h" 27#include "busybox.h"
diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c
index f641be8d7..b89249b87 100644
--- a/console-tools/deallocvt.c
+++ b/console-tools/deallocvt.c
@@ -1,8 +1,27 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * disalloc.c - aeb - 940501 - Disallocate virtual terminal(s) 3 * Disallocate virtual terminal(s)
4 * Renamed deallocvt. 4 *
5 * Copyright (C) 2003 by Tito Ragusa <farmatito@tiscali.it>
6 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
5 */ 21 */
22
23/* no options, no getopt */
24
6#include <stdlib.h> 25#include <stdlib.h>
7#include <stdio.h> 26#include <stdio.h>
8#include <fcntl.h> 27#include <fcntl.h>
@@ -15,21 +34,21 @@ static const int VT_DISALLOCATE = 0x5608; /* free memory associated to vt */
15 34
16int deallocvt_main(int argc, char *argv[]) 35int deallocvt_main(int argc, char *argv[])
17{ 36{
18 int fd, num=0; 37 int fd, num = 0;
19 38
20 if (argc > 2) 39 if (argc > 2) {
21 bb_show_usage(); 40 bb_show_usage();
41 }
22 42
23 fd = get_console_fd(); 43 fd = get_console_fd();
24 44
25 /* num=0 deallocate all unused consoles */ 45 /* num=0 deallocate all unused consoles */
26 if (argc == 1) 46 if (argc == 1) {
27 goto disallocate_all; 47 goto disallocate_all;
48 }
28 49
29 num=bb_xgetlarg(argv[1], 10, 0, INT_MAX); 50 num = bb_xgetlarg(argv[1], 10, 0, INT_MAX);
30 51 switch (num) {
31 switch(num)
32 {
33 case 0: 52 case 0:
34 bb_error_msg("0: illegal VT number"); 53 bb_error_msg("0: illegal VT number");
35 break; 54 break;
@@ -38,8 +57,9 @@ int deallocvt_main(int argc, char *argv[])
38 break; 57 break;
39 default: 58 default:
40disallocate_all: 59disallocate_all:
41 if (ioctl(fd, VT_DISALLOCATE, num)) 60 if (ioctl(fd, VT_DISALLOCATE, num)) {
42 bb_perror_msg_and_die("VT_DISALLOCATE"); 61 bb_perror_msg_and_die("VT_DISALLOCATE");
62 }
43 return EXIT_SUCCESS; 63 return EXIT_SUCCESS;
44 } 64 }
45 return EXIT_FAILURE; 65 return EXIT_FAILURE;
diff --git a/console-tools/reset.c b/console-tools/reset.c
index 69b1e846a..a3f01aab0 100644
--- a/console-tools/reset.c
+++ b/console-tools/reset.c
@@ -21,13 +21,15 @@
21 * 21 *
22 */ 22 */
23 23
24/* no options, no getopt */
25
24#include <stdio.h> 26#include <stdio.h>
25#include <stdlib.h> 27#include <stdlib.h>
26#include "busybox.h" 28#include "busybox.h"
27 29
28extern int reset_main(int argc, char **argv) 30extern int reset_main(int argc, char **argv)
29{ 31{
30 printf("\033[?25h\033c\033[J"); 32 printf("\033[?25h\033c\033[J");
31 return EXIT_SUCCESS; 33 return EXIT_SUCCESS;
32} 34}
33 35