Changeset 2187


Ignore:
Timestamp:
Apr 30, 2009, 6:00:14 PM (10 years ago)
Author:
bruno
Message:

Cleanup of code to remove duplication

File:
1 edited

Legend:

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

    r2177 r2187  
    21032103    char *exclude_these_devices;
    21042104    char *exclude_these_directories;
    2105     static char result_sz[512];
     2105    static char result_sz[1024];
    21062106
    21072107    malloc_string(exclude_these_devices);
    21082108    malloc_string(exclude_these_directories);
    2109     strcpy(exclude_these_directories,
    2110            call_program_and_get_last_line_of_output
    2111            ("mount -t coda,ncpfs,nfs,nfs4,smbfs,cifs,afs,gfs,ocfs,ocfs2,mvfs,nsspool,nssvol | tr -s '\t' ' ' | cut -d' ' -f3 | tr -s '\n' ' ' | awk '{print $0;}'"));
     2109    strcpy(exclude_these_directories,list_of_NFS_mounts_only());
    21122110    strcpy(exclude_these_devices,
    21132111           call_program_and_get_last_line_of_output
     
    21312129char *list_of_NFS_mounts_only(void)
    21322130{
    2133     char *exclude_these_devices;
    21342131    char *exclude_these_directories;
    21352132    static char result_sz[512];
    21362133
    2137     malloc_string(exclude_these_devices);
    21382134    malloc_string(exclude_these_directories);
    21392135    strcpy(exclude_these_directories,
    21402136           call_program_and_get_last_line_of_output
    21412137           ("mount -t coda,ncpfs,nfs,nfs4,smbfs,cifs,afs,gfs,ocfs,ocfs2,mvfs,nsspool,nssvol | tr -s '\t' ' ' | cut -d' ' -f3 | tr -s '\n' ' ' | awk '{print $0;}'"));
    2142     strcpy(exclude_these_devices,
    2143            call_program_and_get_last_line_of_output
    2144            ("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|nfs|nfs4|smbfs|cifs|afs|gfs|ocfs|ocfs2|mvfs|nsspool|nssvol) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'"));
    21452138    sprintf(result_sz, "%s", exclude_these_directories);
    2146     paranoid_free(exclude_these_devices);
    21472139    paranoid_free(exclude_these_directories);
    21482140    return (result_sz);
Note: See TracChangeset for help on using the changeset viewer.