diff options
| author | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-12-22 01:48:07 +0000 |
|---|---|---|
| committer | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-12-22 01:48:07 +0000 |
| commit | 2230e04b24d58710b30d25f032c1996a143ba261 (patch) | |
| tree | b8cb8d939032c0806d62161b01e5836cb808dc3f /console-tools/deallocvt.c | |
| parent | 3c7e7e11b41d4a421bcf42fd1bf72a537e051d4a (diff) | |
| download | busybox-w32-2230e04b24d58710b30d25f032c1996a143ba261.tar.gz busybox-w32-2230e04b24d58710b30d25f032c1996a143ba261.tar.bz2 busybox-w32-2230e04b24d58710b30d25f032c1996a143ba261.zip | |
Use busybox error handling functions wherever possible.
git-svn-id: svn://busybox.net/trunk/busybox@1489 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'console-tools/deallocvt.c')
| -rw-r--r-- | console-tools/deallocvt.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c index b128c3fae..3dd90c0e9 100644 --- a/console-tools/deallocvt.c +++ b/console-tools/deallocvt.c | |||
| @@ -25,10 +25,8 @@ int deallocvt_main(int argc, char *argv[]) | |||
| 25 | 25 | ||
| 26 | if (argc == 1) { | 26 | if (argc == 1) { |
| 27 | /* deallocate all unused consoles */ | 27 | /* deallocate all unused consoles */ |
| 28 | if (ioctl(fd, VT_DISALLOCATE, 0)) { | 28 | if (ioctl(fd, VT_DISALLOCATE, 0)) |
| 29 | perror("VT_DISALLOCATE"); | 29 | perror_msg_and_die("VT_DISALLOCATE"); |
| 30 | return EXIT_FAILURE; | ||
| 31 | } | ||
| 32 | } else { | 30 | } else { |
| 33 | for (i = 1; i < argc; i++) { | 31 | for (i = 1; i < argc; i++) { |
| 34 | num = atoi(argv[i]); | 32 | num = atoi(argv[i]); |
| @@ -36,10 +34,8 @@ int deallocvt_main(int argc, char *argv[]) | |||
| 36 | error_msg("0: illegal VT number\n"); | 34 | error_msg("0: illegal VT number\n"); |
| 37 | else if (num == 1) | 35 | else if (num == 1) |
| 38 | error_msg("VT 1 cannot be deallocated\n"); | 36 | error_msg("VT 1 cannot be deallocated\n"); |
| 39 | else if (ioctl(fd, VT_DISALLOCATE, num)) { | 37 | else if (ioctl(fd, VT_DISALLOCATE, num)) |
| 40 | perror("VT_DISALLOCATE"); | 38 | perror_msg_and_die("VT_DISALLOCATE"); |
| 41 | error_msg_and_die("could not deallocate console %d\n", num); | ||
| 42 | } | ||
| 43 | } | 39 | } |
| 44 | } | 40 | } |
| 45 | 41 | ||
