bb_show_usage();
}
- fd = open(CURRENT_VC, O_RDWR);
- if (fd < 0) {
- bb_perror_msg("Error opening " CURRENT_VC);
- return EXIT_FAILURE;
- }
+ fd=bb_xopen(CURRENT_VC, O_RDWR);
write(1, magic, 7);
bb_show_usage();
}
- fd = open(CURRENT_VC, O_RDWR);
- if (fd < 0) {
- bb_perror_msg_and_die("Error opening " CURRENT_VC);
- }
+ fd = bb_xopen(CURRENT_VC, O_RDWR);
if (screen_map_load(fd, stdin)) {
bb_perror_msg_and_die("Error loading acm");
if (argc != 1)
bb_show_usage();
- fd = open(CURRENT_VC, O_RDWR);
- if (fd < 0)
- bb_perror_msg_and_die("Error opening " CURRENT_VC);
+ fd = bb_xopen(CURRENT_VC, O_RDWR);
loadnewfont(fd);
return EXIT_SUCCESS;
if (!isdigit(argv[1][0]))
bb_show_usage();
- vtno = (int) atol(argv[1]);
-
- /* if (vtno <= 0 || vtno > 63) */
- if (vtno <= 0 || vtno > 12)
- bb_error_msg_and_die("Illegal vt number (%d)", vtno);
+ /* check for Illegal vt number */
+ vtno=bb_xgetlarg(argv[1], 10, 1, 12);
sprintf(vtname, VTNAME, vtno);
close(0); /* so that new vt becomes stdin */
/* and grab new one */
- if ((fd = open(vtname, O_RDWR)) == -1)
- bb_perror_msg_and_die("could not open %s", vtname);
+ fd = bb_xopen(vtname, O_RDWR);
/* Reassign stdout and sterr */
close(1);