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/util-linux/setarch.c

    r1765 r2725  
    11/* vi: set sw=4 ts=4: */
    22/*
    3  * Linux32/linux64 allows for changing uname emulation.
     3 * linux32/linux64 allows for changing uname emulation.
    44 *
    55 * Copyright 2002 Andi Kleen, SuSE Labs.
    66 *
    7  * Licensed under GPL v2 or later, see file License for details.
     7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
    88*/
    99
     
    1212#include "libbb.h"
    1313
    14 int setarch_main(int ATTRIBUTE_UNUSED argc, char **argv);
    15 int setarch_main(int ATTRIBUTE_UNUSED argc, char **argv)
     14int setarch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
     15int setarch_main(int argc UNUSED_PARAM, char **argv)
    1616{
    17     int pers = -1;
     17    int pers;
    1818
    1919    /* Figure out what personality we are supposed to switch to ...
    2020     * we can be invoked as either:
    21      * argv[0],argv[1] -> "setarch","personality"
    22      * argv[0]         -> "personality"
     21     * argv[0],argv[1] == "setarch","personality"
     22     * argv[0]         == "personality"
    2323     */
    24 retry:
    25     if (argv[0][5] == '6') /* linux64 */
     24    if (ENABLE_SETARCH && applet_name[0] == 's'
     25     && argv[1] && strncpy(argv[1], "linux", 5)
     26    ) {
     27        applet_name = argv[1];
     28        argv++;
     29    }
     30    if (applet_name[5] == '6') /* linux64 */
    2631        pers = PER_LINUX;
    27     else if (argv[0][5] == '3') /* linux32 */
     32    else if (applet_name[5] == '3') /* linux32 */
    2833        pers = PER_LINUX32;
    29     else if (pers == -1 && argv[1] != NULL) {
    30         pers = PER_LINUX32;
    31         ++argv;
    32         goto retry;
    33     }
     34    else
     35        bb_show_usage();
    3436
    35     /* make user actually gave us something to do */
    36     ++argv;
     37    argv++;
    3738    if (argv[0] == NULL)
    3839        bb_show_usage();
     
    4041    /* Try to set personality */
    4142    if (personality(pers) >= 0) {
    42 
    4343        /* Try to execute the program */
    4444        BB_EXECVP(argv[0], argv);
    4545    }
    4646
    47     bb_perror_msg_and_die("%s", argv[0]);
     47    bb_simple_perror_msg_and_die(argv[0]);
    4848}
Note: See TracChangeset for help on using the changeset viewer.