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/e2fsprogs/old_e2fsprogs/fsck.c

    r1765 r2725  
    2121 *      2001, 2002, 2003, 2004, 2005 by  Theodore Ts'o.
    2222 *
    23  * %Begin-Header%
    24  * This file may be redistributed under the terms of the GNU Public
    25  * License.
    26  * %End-Header%
     23 * Licensed under GPLv2, see file LICENSE in this source tree.
    2724 */
    2825
     
    286283    if (!s)
    287284        return 0;
    288     ret = strdup(s);
     285    ret = xstrdup(s);
    289286    return ret;
    290287}
     
    353350        return;
    354351
    355     for (p = q = word; *p; q++) {
    356         c = *p++;
    357         if (c != '\\') {
    358             *q = c;
    359         } else {
    360             *q = bb_process_escape_sequence(&p);
    361         }
    362     }
    363     *q = 0;
     352    strcpy_and_process_escape_sequences(word, word);
    364353}
    365354
     
    381370    struct fs_info *fs;
    382371
    383     if (!(fs = malloc(sizeof(struct fs_info))))
    384         return NULL;
     372    fs = xmalloc(sizeof(struct fs_info));
    385373
    386374    fs->device = string_copy(device);
     
    478466    struct fs_info *fs;
    479467
    480     if ((f = fopen(filename, "r")) == NULL) {
    481         bb_perror_msg("WARNING: cannot open %s", filename);
     468    if ((f = fopen_or_warn(filename, "r")) == NULL) {
    482469        return;
    483470    }
     
    535522static char *find_fsck(char *type)
    536523{
    537   char *s;
    538   const char *tpl;
    539   char *p = string_copy(fsck_path);
    540   struct stat st;
    541 
    542   /* Are we looking for a program or just a type? */
    543   tpl = (strncmp(type, "fsck.", 5) ? "%s/fsck.%s" : "%s/%s");
    544 
    545   for(s = strtok(p, ":"); s; s = strtok(NULL, ":")) {
    546     s = xasprintf(tpl, s, type);
    547     if (stat(s, &st) == 0) break;
    548     free(s);
    549   }
    550   free(p);
    551   return s;
     524    char *s;
     525    const char *tpl;
     526    char *p = string_copy(fsck_path);
     527    struct stat st;
     528
     529    /* Are we looking for a program or just a type? */
     530    tpl = (strncmp(type, "fsck.", 5) ? "%s/fsck.%s" : "%s/%s");
     531
     532    for (s = strtok(p, ":"); s; s = strtok(NULL, ":")) {
     533        s = xasprintf(tpl, s, type);
     534        if (stat(s, &st) == 0) break;
     535        free(s);
     536    }
     537    free(p);
     538    return s;
    552539}
    553540
     
    578565    pid_t   pid;
    579566
    580     inst = malloc(sizeof(struct fsck_instance));
    581     if (!inst)
    582         return ENOMEM;
    583     memset(inst, 0, sizeof(struct fsck_instance));
     567    inst = xzalloc(sizeof(struct fsck_instance));
    584568
    585569    prog = xasprintf("fsck.%s", type);
     
    614598        for (i=0; i < argc; i++)
    615599            printf("%s ", argv[i]);
    616         puts("");
     600        bb_putchar('\n');
    617601    }
    618602
     
    621605        pid = -1;
    622606    else if ((pid = fork()) < 0) {
    623         perror("fork");
     607        perror("vfork"+1);
    624608        return errno;
    625609    } else if (pid == 0) {
     
    627611            close(0);
    628612        (void) execv(s, argv);
    629         bb_perror_msg_and_die("%s", argv[0]);
     613        bb_simple_perror_msg_and_die(argv[0]);
    630614    }
    631615
     
    887871    num = 0;
    888872    s = strtok(list, ",");
    889     while(s) {
     873    while (s) {
    890874        negate = 0;
    891875        if (strncmp(s, "no", 2) == 0) {
     
    932916
    933917    s = strtok(list, ",");
    934     while(s) {
     918    while (s) {
    935919        if (strcmp(s, opt) == 0) {
    936920            free(list);
     
    1006990    if (s == NULL) {
    1007991        if (wanted)
    1008             bb_error_msg("cannot check %s: fsck.%s not found",
     992            bb_error_msg("can't check %s: fsck.%s not found",
    1009993                fs->device, fs->type);
    1010994        return 1;
     
    11751159{
    11761160    int     i, j;
    1177     char    *arg, *dev, *tmp = 0;
     1161    char    *arg, *dev, *tmp = NULL;
    11781162    char    options[128];
    11791163    int     opt = 0;
     
    12081192                 */
    12091193                if (access("/proc/partitions", R_OK) < 0) {
    1210                     bb_perror_msg_and_die("cannot open /proc/partitions "
     1194                    bb_perror_msg_and_die("can't open /proc/partitions "
    12111195                            "(is /proc mounted?)");
    12121196                }
     
    12201204                else
    12211205                    bb_error_msg_and_die(
    1222         "cannot find matching filesystem: %s", arg);
     1206        "can't find matching filesystem: %s", arg);
    12231207            }
    12241208            devices[num_devices++] = dev ? dev : string_copy(arg);
     
    13221306}
    13231307
    1324 int fsck_main(int argc, char **argv);
     1308int fsck_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
    13251309int fsck_main(int argc, char **argv)
    13261310{
Note: See TracChangeset for help on using the changeset viewer.