Ignore:
Timestamp:
Nov 4, 2007, 3:16:40 AM (17 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/setconsole.c

    r821 r1765  
    88 */
    99
    10 #include <sys/ioctl.h>
    11 #include <sys/stat.h>
    12 #include <sys/types.h>
    13 #include <fcntl.h>
    14 #include <stdio.h>
    15 #include <getopt.h> /* struct option */
    16 
    17 #include "busybox.h"
     10#include <getopt.h>
     11#include "libbb.h"
    1812
    1913#if ENABLE_FEATURE_SETCONSOLE_LONG_OPTIONS
    20 static const struct option setconsole_long_options[] = {
    21     { "reset", 0, NULL, 'r' },
    22     { 0, 0, 0, 0 }
    23 };
     14static const char setconsole_longopts[] ALIGN1 =
     15    "reset\0" No_argument "r"
     16    ;
    2417#endif
    2518
    2619#define OPT_SETCONS_RESET 1
    2720
     21int setconsole_main(int argc, char **argv);
    2822int setconsole_main(int argc, char **argv)
    2923{
     
    3226
    3327#if ENABLE_FEATURE_SETCONSOLE_LONG_OPTIONS
    34     bb_applet_long_options = setconsole_long_options;
     28    applet_long_options = setconsole_longopts;
    3529#endif
    36     flags = bb_getopt_ulflags(argc, argv, "r");
     30    flags = getopt32(argv, "r");
    3731
    3832    if (argc - optind > 1)
     
    4539    } else {
    4640        if (flags & OPT_SETCONS_RESET)
    47             device = CONSOLE_DEV;
     41            device = DEV_CONSOLE;
    4842    }
    4943
    50     if (-1 == ioctl(bb_xopen(device, O_RDONLY), TIOCCONS)) {
    51         bb_perror_msg_and_die("TIOCCONS");
    52     }
     44    xioctl(xopen(device, O_RDONLY), TIOCCONS, NULL);
    5345    return EXIT_SUCCESS;
    5446}
Note: See TracChangeset for help on using the changeset viewer.