Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/util-linux/flock.c

    r3232 r3621  
    5858     * we use "+" in order to support "flock -opt FILE PROG -with-opts",
    5959     * we need to remove -c by hand.
    60      * TODO: in upstream, -c 'PROG ARGS' means "run sh -c 'PROG ARGS'"
    6160     */
    6261    if (argv[0]
     
    6766    ) {
    6867        argv++;
     68        if (argv[1])
     69            bb_error_msg_and_die("-c takes only one argument");
     70        opt |= OPT_c;
    6971    }
    7072
     
    9193    }
    9294
    93     if (argv[0])
    94         return spawn_and_wait(argv);
     95    if (argv[0]) {
     96        int rc;
     97        if (opt & OPT_c) {
     98            /* -c 'PROG ARGS' means "run sh -c 'PROG ARGS'" */
     99            argv -= 2;
     100            argv[0] = (char*)get_shell_name();
     101            argv[1] = (char*)"-c";
     102            /* argv[2] = "PROG ARGS"; */
     103            /* argv[3] = NULL; */
     104        }
     105        rc = spawn_and_wait(argv);
     106        if (rc < 0)
     107            bb_simple_perror_msg(argv[0]);
     108        return rc;
     109    }
    95110
    96111    return EXIT_SUCCESS;
Note: See TracChangeset for help on using the changeset viewer.