Changeset 839 in MondoRescue for trunk/mondo/src/common


Ignore:
Timestamp:
Sep 26, 2006, 9:47:32 AM (18 years ago)
Author:
Bruno Cornec
Message:

merge -r814:838 $SVN_M/branches/stable

Location:
trunk/mondo/src/common
Files:
5 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/mondo/src/common/Makefile.am

    r826 r839  
    88
    99libmondo_a_SOURCES  = libmondo-archive.c libmondo-devices.c libmondo-fifo.c \
    10                     libmondo-filelist.c libmondo-files.c libmondo-fork.c \
    11                     libmondo-mountlist.c libmondo-raid.c libmondo-msg.c \
    12                     libmondo-stream.c libmondo-string.c libmondo-tools.c \
    13                     libmondo-verify.c newt-specific.c \
    14                     libmondo-archive.h libmondo-devices.h \
    15                     libmondo-filelist.h libmondo-files.h libmondo-fork.h \
    16                     libmondo-mountlist.h libmondo-raid.h \
    17                     libmondo-stream.h libmondo-string.h libmondo-tools.h \
    18                     libmondo-verify.h libmondo-fifo.h \
    19                     libmondo-archive-EXT.h my-stuff.h mondostructures.h \
    20                     libmondo-devices-EXT.h libmondo-fifo-EXT.h \
    21                     libmondo-files-EXT.h libmondo-fork-EXT.h \
    22                     libmondo-filelist-EXT.h \
    23                     libmondo-mountlist-EXT.h libmondo-raid-EXT.h  \
    24                     libmondo-string-EXT.h libmondo-tools-EXT.h \
    25                     libmondo-verify-EXT.h  libmondo-stream-EXT.h \
    26                     newt-specific.h
     10                    libmondo-msg.c \
     11                       libmondo-filelist.c libmondo-files.c libmondo-fork.c \
     12                       libmondo-mountlist.c libmondo-raid.c \
     13                       libmondo-stream.c libmondo-string.c libmondo-tools.c \
     14                       libmondo-verify.c newt-specific.c \
     15                       libmondo-archive.h libmondo-devices.h \
     16                       libmondo-filelist.h libmondo-files.h libmondo-fork.h \
     17                       libmondo-gui.h libmondo-mountlist.h libmondo-raid.h \
     18                       libmondo-stream.h libmondo-string.h libmondo-tools.h \
     19                       libmondo-verify.h libmondo-fifo.h \
     20                       libmondo-archive-EXT.h my-stuff.h mondostructures.h \
     21                       libmondo-devices-EXT.h libmondo-fifo-EXT.h \
     22                       libmondo-files-EXT.h libmondo-fork-EXT.h \
     23                       libmondo-gui-EXT.h libmondo-filelist-EXT.h \
     24                       libmondo-mountlist-EXT.h libmondo-raid-EXT.h  \
     25                       libmondo-string-EXT.h libmondo-tools-EXT.h \
     26                       libmondo-verify-EXT.h  libmondo-stream-EXT.h \
     27                       newt-specific.h
  • trunk/mondo/src/common/libmondo-devices.c

    r835 r839  
    20262026    asprintf(&exclude_these_devices,
    20272027           call_program_and_get_last_line_of_output
    2028            ("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|nfs|smbfs|cifs|afs|mvfs) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'"));
     2028           ("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|nfs|smbfs|cifs|mvfs) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'"));
    20292029           */
    20302030}
  • trunk/mondo/src/common/libmondo-filelist.c

    r795 r839  
    1717#include "newt-specific-EXT.h"
    1818#include "libmondo-tools-EXT.h"
    19 
     19#include "mr_string.h"
    2020
    2121#include <time.h>
     
    13181318                      char *skeleton_filelist)
    13191319{
     1320    const char delims[] = " ";
    13201321    DIR *dip = NULL;
    13211322    struct dirent *dit = NULL;
     1323
    13221324    struct stat statbuf;
    13231325    char *new = NULL;
     
    13291331    static char *name_of_evalcall_form = NULL;
    13301332    int i = 0;
     1333    char *strtmp = NULL;
     1334    char *token = NULL;
     1335    char *find_excludes = NULL;
     1336    int lastpos = 0;
    13311337    static int depth = 0;
    13321338    char *p = NULL;
     
    13471353    if (!depth) {
    13481354        malloc_string(find_skeleton_marker);
     1355        asprintf(&find_excludes, " ");
     1356        while((token = mr_strtok (sth, delims, &lastpos))) {
     1357          asprintf(&strtmp,"%s", find_excludes);
     1358          paranoid_free(find_excludes);
     1359          asprintf(&find_excludes,"%s -path %s -prune -o", strtmp, token);
     1360          paranoid_free(strtmp);
     1361          paranoid_free(token);
     1362        }
    13491363#if linux
    13501364        // 2.6 has /sys as a proc-type thing -- must be excluded
    1351         asprintf(&tmp,
    1352                 "find %s -maxdepth %d -fstype mvfs -prune -o -fstype afs -prune -o -path /proc -prune -o -path /sys -prune -o -path /dev/shm -prune -o -path /media/floppy -prune -o -type d -a -print > %s 2> /dev/null",
    1353                  dir, MAX_SKEL_DEPTH, skeleton_filelist);
     1365        asprintf(&strtmp,
     1366             "find %s -maxdepth %d -fstype mvfs -prune -o -path /dev/shm -prune -o %s -type d -print > %s 2> /dev/null",
     1367             dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist);
    13541368#else
    13551369        // On BSD, for example, /sys is the kernel sources -- don't exclude
    1356         asprintf(&tmp,
    1357                 "find %s -maxdepth %d -fstype mvfs -prune -o -fstype afs -prune -o -path /proc -prune -o -type d -a -print > %s 2> /dev/null",
    1358                  dir, MAX_SKEL_DEPTH, skeleton_filelist);
     1370        asprintf(&strtmp,
     1371             "find %s -maxdepth %d -fstype mvfs -prune -o -path /proc -prune -o %s -type d -print > %s 2> /dev/null",
     1372                dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist);
     1373>>>>>>> .merge-right.r838
    13591374#endif
    1360         system(tmp);
     1375        paranoid_free(find_excludes);
     1376        log_msg(5, "find command = %s", strtmp);
     1377        system(strtmp);
     1378        paranoid_free(strtmp);
    13611379        paranoid_free(tmp);
    13621380
  • trunk/mondo/src/common/libmondo-files.c

    r808 r839  
    772772
    773773    asprintf(&command, "du -sk %s", mountpt);
     774    errno = 0;
    774775    fin = popen(command, "r");
    775     paranoid_free(command);
    776 
    777     (void) getline(&tmp, &n, fin);
    778     paranoid_pclose(fin);
    779     p = strchr(tmp, '\t');
    780     if (p) {
    781         *p = '\0';
    782     }
    783     for (p = tmp, llres = 0; *p != '\0'; p++) {
    784         llres *= 10;
    785         llres += (int) (*p - '0');
    786     }
     776    if (errno) {
     777      log_it("popen() FAILED: command=%s, mountpt=%s, fin=%d, errno=%d, strerror=%s", command, mountpt, fin, errno, strerror(errno));
     778      llres = 0;
     779    } else {
     780        (void) getline(&tmp, &n, fin);
     781        paranoid_pclose(fin);
     782        p = strchr(tmp, '\t');
     783        if (p) {
     784            *p = '\0';
     785        }
     786        for (p = tmp, llres = 0; *p != '\0'; p++) {
     787            llres *= 10;
     788            llres += (int) (*p - '0');
     789        }
     790    }
     791
     792    paranoid_free(command);
    787793    paranoid_free(tmp);
    788794    return (llres);
  • trunk/mondo/src/common/libmondo-raid.c

    r783 r839  
    1616#include "libmondo-string-EXT.h"
    1717#include "libmondo-raid.h"
     18#include "mr_string.h"
    1819
    1920#ifdef __FreeBSD__
Note: See TracChangeset for help on using the changeset viewer.