Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/libbb/mtab.c


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/libbb/mtab.c

    r1765 r2725  
    55 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
    66 *
    7  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
     7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
    88 */
    99
     
    1212
    1313#if ENABLE_FEATURE_MTAB_SUPPORT
    14 void erase_mtab(const char *name)
     14void FAST_FUNC erase_mtab(const char *name)
    1515{
    16     struct mntent *entries = NULL;
    17     int i, count = 0;
     16    struct mntent *entries;
     17    int i, count;
    1818    FILE *mountTable;
    1919    struct mntent *m;
     
    2727    }
    2828
     29    entries = NULL;
     30    count = 0;
    2931    while ((m = getmntent(mountTable)) != 0) {
    30         i = count++;
    31         entries = xrealloc(entries, count * sizeof(entries[0]));
    32         entries[i].mnt_fsname = xstrdup(m->mnt_fsname);
    33         entries[i].mnt_dir = xstrdup(m->mnt_dir);
    34         entries[i].mnt_type = xstrdup(m->mnt_type);
    35         entries[i].mnt_opts = xstrdup(m->mnt_opts);
    36         entries[i].mnt_freq = m->mnt_freq;
    37         entries[i].mnt_passno = m->mnt_passno;
     32        entries = xrealloc_vector(entries, 3, count);
     33        entries[count].mnt_fsname = xstrdup(m->mnt_fsname);
     34        entries[count].mnt_dir = xstrdup(m->mnt_dir);
     35        entries[count].mnt_type = xstrdup(m->mnt_type);
     36        entries[count].mnt_opts = xstrdup(m->mnt_opts);
     37        entries[count].mnt_freq = m->mnt_freq;
     38        entries[count].mnt_passno = m->mnt_passno;
     39        count++;
    3840    }
    3941    endmntent(mountTable);
    4042
     43//TODO: make update atomic
    4144    mountTable = setmntent(bb_path_mtab_file, "w");
    4245    if (mountTable) {
Note: See TracChangeset for help on using the changeset viewer.