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/ipcs.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
     
    6969    int val;
    7070    struct semid_ds *buf;
    71     unsigned short int *array;
     71    unsigned short *array;
    7272    struct seminfo *__buf;
    7373};
     
    100100    printf("%-10d %-10o", id, ipcp->mode & 0777);
    101101
    102     if ((pw = getpwuid(ipcp->cuid)))
    103         printf(" %-10s", pw->pw_name);
    104     else
    105         printf(" %-10d", ipcp->cuid);
    106     if ((gr = getgrgid(ipcp->cgid)))
    107         printf(" %-10s", gr->gr_name);
    108     else
    109         printf(" %-10d", ipcp->cgid);
    110 
    111     if ((pw = getpwuid(ipcp->uid)))
    112         printf(" %-10s", pw->pw_name);
    113     else
    114         printf(" %-10d", ipcp->uid);
    115     if ((gr = getgrgid(ipcp->gid)))
    116         printf(" %-10s\n", gr->gr_name);
    117     else
    118         printf(" %-10d\n", ipcp->gid);
    119 }
    120 
    121 
    122 static void do_shm(void)
     102    pw = getpwuid(ipcp->cuid);
     103    if (pw) printf(" %-10s", pw->pw_name);
     104    else    printf(" %-10d", ipcp->cuid);
     105    gr = getgrgid(ipcp->cgid);
     106    if (gr) printf(" %-10s", gr->gr_name);
     107    else    printf(" %-10d", ipcp->cgid);
     108
     109    pw = getpwuid(ipcp->uid);
     110    if (pw) printf(" %-10s", pw->pw_name);
     111    else    printf(" %-10d", ipcp->uid);
     112    gr = getgrgid(ipcp->gid);
     113    if (gr) printf(" %-10s\n", gr->gr_name);
     114    else    printf(" %-10d\n", ipcp->gid);
     115}
     116
     117
     118static NOINLINE void do_shm(void)
    123119{
    124120    int maxid, shmid, id;
     
    247243
    248244
    249 static void do_sem(void)
     245static NOINLINE void do_sem(void)
    250246{
    251247    int maxid, semid, id;
     
    353349
    354350
    355 static void do_msg(void)
     351static NOINLINE void do_msg(void)
    356352{
    357353    int maxid, msqid, id;
     
    560556        printf("%-10d %-10d %-10d %-10d %-10d\n", i, val, ncnt, zcnt, pid);
    561557    }
    562     puts("");
    563 }
    564 
    565 int ipcs_main(int argc, char **argv);
    566 int ipcs_main(int argc, char **argv)
     558    bb_putchar('\n');
     559}
     560
     561int ipcs_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
     562int ipcs_main(int argc UNUSED_PARAM, char **argv)
    567563{
    568564    int id = 0;
     
    593589        if (flags & flag_shm) {
    594590            print_shm(id);
    595             fflush_stdout_and_exit(0);
     591            fflush_stdout_and_exit(EXIT_SUCCESS);
    596592        }
    597593        if (flags & flag_sem) {
    598594            print_sem(id);
    599             fflush_stdout_and_exit(0);
     595            fflush_stdout_and_exit(EXIT_SUCCESS);
    600596        }
    601597        if (flags & flag_msg) {
    602598            print_msg(id);
    603             fflush_stdout_and_exit(0);
     599            fflush_stdout_and_exit(EXIT_SUCCESS);
    604600        }
    605601        bb_show_usage();
     
    608604    if (!(flags & (flag_shm | flag_msg | flag_sem)))
    609605        flags |= flag_msg | flag_shm | flag_sem;
    610     puts("");
     606    bb_putchar('\n');
    611607
    612608    if (flags & flag_shm) {
    613609        do_shm();
    614         puts("");
     610        bb_putchar('\n');
    615611    }
    616612    if (flags & flag_sem) {
    617613        do_sem();
    618         puts("");
     614        bb_putchar('\n');
    619615    }
    620616    if (flags & flag_msg) {
    621617        do_msg();
    622         puts("");
    623     }
    624     fflush_stdout_and_exit(0);
    625 }
     618        bb_putchar('\n');
     619    }
     620    fflush_stdout_and_exit(EXIT_SUCCESS);
     621}
Note: See TracChangeset for help on using the changeset viewer.