aboutsummaryrefslogtreecommitdiff
path: root/console-tools
diff options
context:
space:
mode:
authorGravatar Matt Kraai <kraai@debian.org>2000-12-14 05:44:36 +0000
committerGravatar Matt Kraai <kraai@debian.org>2000-12-14 05:44:36 +0000
commitaefe5629abec3e51890b0aee97a201a22bb4cc4a (patch)
tree64d18d2c974bff90d19f5ab71a82b2b13a3751f8 /console-tools
parent95fa0ea3d421772f29f78e3484ad824ffd5e8b6f (diff)
downloadbusybox-aefe5629abec3e51890b0aee97a201a22bb4cc4a.tar.gz
busybox-aefe5629abec3e51890b0aee97a201a22bb4cc4a.tar.bz2
Simplify error handling.
Diffstat (limited to 'console-tools')
-rw-r--r--console-tools/chvt.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/console-tools/chvt.c b/console-tools/chvt.c
index 790964586..76d4b53a6 100644
--- a/console-tools/chvt.c
+++ b/console-tools/chvt.c
@@ -23,14 +23,10 @@ int chvt_main(int argc, char **argv)
usage (chvt_usage);
fd = get_console_fd("/dev/console");
num = atoi(argv[1]);
- if (ioctl(fd, VT_ACTIVATE, num)) {
- perror("VT_ACTIVATE");
- return EXIT_FAILURE;
- }
- if (ioctl(fd, VT_WAITACTIVE, num)) {
- perror("VT_WAITACTIVE");
- return EXIT_FAILURE;
- }
+ if (ioctl(fd, VT_ACTIVATE, num))
+ perror_msg_and_die("VT_ACTIVATE");
+ if (ioctl(fd, VT_WAITACTIVE, num))
+ perror_msg_and_die("VT_WAITACTIVE");
return EXIT_SUCCESS;
}