Ignore:
Timestamp:
Nov 4, 2007, 3:16:40 AM (16 years ago)
Author:
Bruno Cornec
Message:

Update to busybox 1.7.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mindi-busybox/console-tools/chvt.c

    r821 r1765  
    88 */
    99
    10 #include <stdio.h>
    11 #include <stdlib.h>
    12 #include <fcntl.h>
    13 #include <sys/types.h>
    14 #include <sys/ioctl.h>
    15 #include "busybox.h"
     10#include "libbb.h"
    1611
    1712/* From <linux/vt.h> */
     
    2116};
    2217
     18int chvt_main(int argc, char **argv);
    2319int chvt_main(int argc, char **argv)
    2420{
     
    3026
    3127    fd = get_console_fd();
    32     num =  bb_xgetlarg(argv[1], 10, 0, INT_MAX);
    33     if ((-1 == ioctl(fd, VT_ACTIVATE, num))
    34     || (-1 == ioctl(fd, VT_WAITACTIVE, num))) {
    35         bb_perror_msg_and_die("ioctl");
    36     }
     28    num = xatou_range(argv[1], 1, 63);
     29    /* double cast suppresses "cast to ptr from int of different size */
     30    xioctl(fd, VT_ACTIVATE, (void *)(ptrdiff_t)num);
     31    xioctl(fd, VT_WAITACTIVE, (void *)(ptrdiff_t)num);
    3732    return EXIT_SUCCESS;
    3833}
Note: See TracChangeset for help on using the changeset viewer.