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/ipcrm.c

    r1765 r2725  
    66 * Adapted for busybox from util-linux-2.12a.
    77 *
    8  * 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.
    99 */
    1010
     
    2525    int val;
    2626    struct semid_ds *buf;
    27     unsigned short int *array;
     27    unsigned short *array;
    2828    struct seminfo *__buf;
    2929};
     
    4141} type_id;
    4242
    43 static int remove_ids(type_id type, int argc, char **argv)
     43static int remove_ids(type_id type, char **argv)
    4444{
    4545    unsigned long id;
    46     int ret = 0;        /* silence gcc */
    4746    int nb_errors = 0;
    4847    union semun arg;
     
    5049    arg.val = 0;
    5150
    52     while (argc) {
     51    while (argv[0]) {
    5352        id = bb_strtoul(argv[0], NULL, 10);
    5453        if (errno || id > INT_MAX) {
     
    5655            nb_errors++;
    5756        } else {
     57            int ret = 0;
    5858            if (type == SEM)
    5959                ret = semctl(id, 0, IPC_RMID, arg);
     
    6464
    6565            if (ret) {
    66                 bb_perror_msg("cannot remove id %s", argv[0]);
     66                bb_perror_msg("can't remove id %s", argv[0]);
    6767                nb_errors++;
    6868            }
    6969        }
    70         argc--;
    7170        argv++;
    7271    }
     
    7776
    7877
    79 int ipcrm_main(int argc, char **argv);
     78int ipcrm_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
    8079int ipcrm_main(int argc, char **argv)
    8180{
     
    9392        char w;
    9493
    95         w=argv[1][0];
     94        w = argv[1][0];
    9695        if ( ((w == 'm' && argv[1][1] == 's' && argv[1][2] == 'g')
    9796               || (argv[1][0] == 's'
    98                    && ((w=argv[1][1]) == 'h' || w == 'e')
     97                   && ((w = argv[1][1]) == 'h' || w == 'e')
    9998                   && argv[1][2] == 'm')
    10099             ) && argv[1][3] == '\0'
    101100        ) {
    102 
    103101            if (argc < 3)
    104102                bb_show_usage();
     
    111109                what = SEM;
    112110
    113             if (remove_ids(what, argc-2, &argv[2]))
    114                 fflush_stdout_and_exit(1);
     111            if (remove_ids(what, &argv[2]))
     112                fflush_stdout_and_exit(EXIT_FAILURE);
    115113            printf("resource(s) deleted\n");
    116114            return 0;
     
    123121        int result;
    124122        int id = 0;
    125         int iskey = (isupper)(c);
     123        int iskey = isupper(c);
    126124
    127125        /* needed to delete semaphores */
Note: See TracChangeset for help on using the changeset viewer.