Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/console-tools/setconsole.c

    r1765 r2725  
    44 *
    55 *  Copyright (C) 2004,2005  Enrik Berkhan <Enrik.Berkhan@inka.de>
     6 *  Copyright (C) 2008 Bernhard Reutner-Fischer
    67 *
    7  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
     8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
    89 */
    910
    10 #include <getopt.h>
    1111#include "libbb.h"
    1212
    13 #if ENABLE_FEATURE_SETCONSOLE_LONG_OPTIONS
    14 static const char setconsole_longopts[] ALIGN1 =
    15     "reset\0" No_argument "r"
    16     ;
    17 #endif
    18 
    19 #define OPT_SETCONS_RESET 1
    20 
    21 int setconsole_main(int argc, char **argv);
    22 int setconsole_main(int argc, char **argv)
     13int setconsole_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
     14int setconsole_main(int argc UNUSED_PARAM, char **argv)
    2315{
    24     unsigned long flags;
    2516    const char *device = CURRENT_TTY;
     17    bool reset;
    2618
    2719#if ENABLE_FEATURE_SETCONSOLE_LONG_OPTIONS
     20    static const char setconsole_longopts[] ALIGN1 =
     21        "reset\0" No_argument "r"
     22        ;
    2823    applet_long_options = setconsole_longopts;
    2924#endif
    30     flags = getopt32(argv, "r");
     25    /* at most one non-option argument */
     26    opt_complementary = "?1";
     27    reset = getopt32(argv, "r");
    3128
    32     if (argc - optind > 1)
    33         bb_show_usage();
    34 
    35     if (argc - optind == 1) {
    36         if (flags & OPT_SETCONS_RESET)
    37             bb_show_usage();
    38         device = argv[optind];
     29    argv += 1 + reset;
     30    if (*argv) {
     31        device = *argv;
    3932    } else {
    40         if (flags & OPT_SETCONS_RESET)
     33        if (reset)
    4134            device = DEV_CONSOLE;
    4235    }
Note: See TracChangeset for help on using the changeset viewer.