Changeset 3604


Ignore:
Timestamp:
Sep 6, 2016, 5:38:38 PM (3 years ago)
Author:
bruno
Message:

Fix #806 by setuping env var for english before callingcommands and avoid local msgs badly interpreted later on (F. Sommer)

Location:
branches/3.2/mondo/src/common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mondo/src/common/libmondo-devices.c

    r3594 r3604  
    21962196         */
    21972197#ifdef __FreeBSD__
    2198         mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output("LANGUAGE=C df -m -P -t nonfs,msdosfs,ntfs,ntfs-3g,vmhgfs,smbfs,smb,cifs,afs,gfs,ocfs,ocfs2,mvfs,nsspool,nssvol | grep -vE \"none|Filesystem\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -nr | awk '{print $NF;}' | while read x ; do test -w $x && echo $x && break ; done"));
     2198        mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output("df -m -P -t nonfs,msdosfs,ntfs,ntfs-3g,vmhgfs,smbfs,smb,cifs,afs,gfs,ocfs,ocfs2,mvfs,nsspool,nssvol | grep -vE \"none|Filesystem\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -nr | awk '{print $NF;}' | while read x ; do test -w $x && echo $x && break ; done"));
    21992199#else
    2200         mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output("LANGUAGE=C df -m -P -x nfs -x nfs4 -x fuse.sshfs -x fuse -x vfat -x ntfs -x ntfs-3g -x vmhgfs -x smbfs -x smb -x cifs -x afs -x gfs -x ocfs -x ocfs2 -x mvfs -x nsspool -x nssvol -x iso9660 | grep -vE \"none|Filesystem|/dev/shm\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -nr | awk '{print $NF;}' | while read x ; do test -w $x && echo $x && break ; done"));
     2200        mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output("df -m -P -x nfs -x nfs4 -x fuse.sshfs -x fuse -x vfat -x ntfs -x ntfs-3g -x vmhgfs -x smbfs -x smb -x cifs -x afs -x gfs -x ocfs -x ocfs2 -x mvfs -x nsspool -x nssvol -x iso9660 | grep -vE \"none|Filesystem|/dev/shm\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -nr | awk '{print $NF;}' | while read x ; do test -w $x && echo $x && break ; done"));
    22012201#endif
    22022202
  • branches/3.2/mondo/src/common/libmondo-fork.c

    r3568 r3604  
    4545    /*@ pointers **************************************************** */
    4646    FILE *fin = NULL;
     47    char *eng_call = NULL;
    4748
    4849    /*@ initialize data ********************************************* */
     
    5253
    5354    assert_string_is_neither_NULL_nor_zerolength(call);
    54     log_msg(5, "cpaglloo called with '%s'", call);
    55     if ((fin = popen(call, "r"))) {
     55    mr_asprintf(eng_call,"LANG=C LANGUAGE=C %s",call);
     56    log_msg(5, "cpaglloo called with '%s'", eng_call);
     57    if ((fin = popen(eng_call, "r"))) {
    5658        while (!feof(fin)) {
    5759            mr_getline(tmp, fin);
     
    6668        log_OS_error("Unable to open resulting file");
    6769    }
     70    mr_free(eng_call);
    6871    strip_spaces(result);
    6972    log_msg(5, "cpaglloo returns '%s'", result);
Note: See TracChangeset for help on using the changeset viewer.