Changeset 305 in MondoRescue for branches/2.06/mondo/mondo/common


Ignore:
Timestamp:
Jan 12, 2006, 5:37:42 PM (18 years ago)
Author:
bcornec
Message:

use df -P everywhere to avoid split lines on df output and some bugs

Location:
branches/2.06/mondo/mondo/common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.06/mondo/mondo/common/libmondo-archive.c

    r296 r305  
    545545    if (g_tmpfs_mountpt[0] != '\0') {
    546546        i = atoi(call_program_and_get_last_line_of_output
    547                  ("df -m | grep dev/shm | grep -v none | tr -s ' ' '\t' | cut -f4"));
     547                 ("df -m -P | grep dev/shm | grep -v none | tr -s ' ' '\t' | cut -f4"));
    548548        if (i > 0) {
    549549            if (free_ramdisk_space > i) {
  • branches/2.06/mondo/mondo/common/libmondo-devices.c

    r275 r305  
    25232523    strcpy(tmp,
    25242524           call_program_and_get_last_line_of_output
    2525            ("df -m -t nonfs,msdosfs,ntfs,smbfs,smb,cifs | tr -s '\t' ' ' | grep -v none | grep -v Filesystem | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));
     2525           ("df -m -P -t nonfs,msdosfs,ntfs,smbfs,smb,cifs | tr -s '\t' ' ' | grep -v none | grep -v Filesystem | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));
    25262526#else
    25272527    strcpy(tmp,
    25282528           call_program_and_get_last_line_of_output
    2529            ("df -m -x nfs -x vfat -x ntfs -x smbfs -x smb -x cifs | sed 's/                  /devdev/' | tr -s '\t' ' ' | grep -v none | grep -v Filesystem | grep -v /dev/shm | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));
     2529           ("df -m -P -x nfs -x vfat -x ntfs -x smbfs -x smb -x cifs | sed 's/                  /devdev/' | tr -s '\t' ' ' | grep -v none | grep -v Filesystem | grep -v /dev/shm | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));
    25302530#endif
    25312531
  • branches/2.06/mondo/mondo/common/libmondo-tools.c

    r275 r305  
    10141014    assert_string_is_neither_NULL_nor_zerolength(partition);
    10151015
    1016     sprintf(command, "df -m %s &> /dev/null", partition);
     1016    sprintf(command, "df -m -P %s &> /dev/null", partition);
    10171017    if (system(command)) {
    10181018        return (-1);
    10191019    }                           // partition does not exist
    1020     sprintf(command, "df -m %s | tail -n1 | tr -s ' ' '\t' | cut -f4",
     1020    sprintf(command, "df -m -P %s | tail -n1 | tr -s ' ' '\t' | cut -f4",
    10211021            partition);
    10221022    strcpy(out_sz, call_program_and_get_last_line_of_output(command));
Note: See TracChangeset for help on using the changeset viewer.