diff options
-rw-r--r-- | console-tools/deallocvt.c | 9 | ||||
-rw-r--r-- | deallocvt.c | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c index a5b5a03f0..bb9632fde 100644 --- a/console-tools/deallocvt.c +++ b/console-tools/deallocvt.c | |||
@@ -17,18 +17,21 @@ int deallocvt_main(int argc, char *argv[]) | |||
17 | { | 17 | { |
18 | int fd, num, i; | 18 | int fd, num, i; |
19 | 19 | ||
20 | if ((argc > 2) || ((argv == 2) && (**(argv + 1) == '-'))) | 20 | //if ((argc > 2) || ((argv == 2) && (**(argv + 1) == '-'))) |
21 | if (argc > 2) | ||
21 | usage(deallocvt_usage); | 22 | usage(deallocvt_usage); |
22 | 23 | ||
23 | fd = get_console_fd("/dev/console"); | 24 | fd = get_console_fd("/dev/console"); |
24 | 25 | ||
25 | if (argc == 1) { | 26 | if (argc == 1) { |
27 | printf("erik: A\n"); | ||
26 | /* deallocate all unused consoles */ | 28 | /* deallocate all unused consoles */ |
27 | if (ioctl(fd, VT_DISALLOCATE, 0)) { | 29 | if (ioctl(fd, VT_DISALLOCATE, 0)) { |
28 | perror("VT_DISALLOCATE"); | 30 | perror("VT_DISALLOCATE"); |
29 | exit( FALSE); | 31 | exit( FALSE); |
30 | } | 32 | } |
31 | } else | 33 | } else |
34 | printf("erik: B\n"); | ||
32 | for (i = 1; i < argc; i++) { | 35 | for (i = 1; i < argc; i++) { |
33 | num = atoi(argv[i]); | 36 | num = atoi(argv[i]); |
34 | if (num == 0) | 37 | if (num == 0) |
@@ -37,9 +40,9 @@ int deallocvt_main(int argc, char *argv[]) | |||
37 | errorMsg("VT 1 cannot be deallocated\n"); | 40 | errorMsg("VT 1 cannot be deallocated\n"); |
38 | else if (ioctl(fd, VT_DISALLOCATE, num)) { | 41 | else if (ioctl(fd, VT_DISALLOCATE, num)) { |
39 | perror("VT_DISALLOCATE"); | 42 | perror("VT_DISALLOCATE"); |
40 | errorMsg("could not deallocate console %d\n", num); | 43 | fatalError("could not deallocate console %d\n", num); |
41 | exit( FALSE); | ||
42 | } | 44 | } |
43 | } | 45 | } |
46 | printf("erik: C\n"); | ||
44 | return( TRUE); | 47 | return( TRUE); |
45 | } | 48 | } |
diff --git a/deallocvt.c b/deallocvt.c index a5b5a03f0..bb9632fde 100644 --- a/deallocvt.c +++ b/deallocvt.c | |||
@@ -17,18 +17,21 @@ int deallocvt_main(int argc, char *argv[]) | |||
17 | { | 17 | { |
18 | int fd, num, i; | 18 | int fd, num, i; |
19 | 19 | ||
20 | if ((argc > 2) || ((argv == 2) && (**(argv + 1) == '-'))) | 20 | //if ((argc > 2) || ((argv == 2) && (**(argv + 1) == '-'))) |
21 | if (argc > 2) | ||
21 | usage(deallocvt_usage); | 22 | usage(deallocvt_usage); |
22 | 23 | ||
23 | fd = get_console_fd("/dev/console"); | 24 | fd = get_console_fd("/dev/console"); |
24 | 25 | ||
25 | if (argc == 1) { | 26 | if (argc == 1) { |
27 | printf("erik: A\n"); | ||
26 | /* deallocate all unused consoles */ | 28 | /* deallocate all unused consoles */ |
27 | if (ioctl(fd, VT_DISALLOCATE, 0)) { | 29 | if (ioctl(fd, VT_DISALLOCATE, 0)) { |
28 | perror("VT_DISALLOCATE"); | 30 | perror("VT_DISALLOCATE"); |
29 | exit( FALSE); | 31 | exit( FALSE); |
30 | } | 32 | } |
31 | } else | 33 | } else |
34 | printf("erik: B\n"); | ||
32 | for (i = 1; i < argc; i++) { | 35 | for (i = 1; i < argc; i++) { |
33 | num = atoi(argv[i]); | 36 | num = atoi(argv[i]); |
34 | if (num == 0) | 37 | if (num == 0) |
@@ -37,9 +40,9 @@ int deallocvt_main(int argc, char *argv[]) | |||
37 | errorMsg("VT 1 cannot be deallocated\n"); | 40 | errorMsg("VT 1 cannot be deallocated\n"); |
38 | else if (ioctl(fd, VT_DISALLOCATE, num)) { | 41 | else if (ioctl(fd, VT_DISALLOCATE, num)) { |
39 | perror("VT_DISALLOCATE"); | 42 | perror("VT_DISALLOCATE"); |
40 | errorMsg("could not deallocate console %d\n", num); | 43 | fatalError("could not deallocate console %d\n", num); |
41 | exit( FALSE); | ||
42 | } | 44 | } |
43 | } | 45 | } |
46 | printf("erik: C\n"); | ||
44 | return( TRUE); | 47 | return( TRUE); |
45 | } | 48 | } |