Ticket #3547: mc-3547-cleanup-mountlist.c-remove-unused-read_file_system_list-parameter.patch

File mc-3547-cleanup-mountlist.c-remove-unused-read_file_system_list-parameter.patch, 2.8 KB (added by and, 6 years ago)
  • src/filemanager/mountlist.c

    From 01a7406e270277001bdb8e0ac277da3328c138ec Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sun, 17 Jan 2016 16:43:31 +0000
    Subject: [PATCH] cleanup mountlist.c remove unused read_file_system_list() parameter
    
    need_fs_type and all_fs never varied
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/filemanager/mountlist.c | 27 +++++++++++----------------
     1 file changed, 11 insertions(+), 16 deletions(-)
    
    diff --git a/src/filemanager/mountlist.c b/src/filemanager/mountlist.c
    index 3aa7a6a..14477b1 100644
    a b unescape_tab (char *str) 
    645645   the returned list are valid.  Otherwise, they might not be.  */ 
    646646 
    647647static GSList * 
    648 read_file_system_list (int need_fs_type) 
     648read_file_system_list (void) 
    649649{ 
    650650    GSList *mount_list = NULL; 
    651651    struct mount_entry *me; 
    read_file_system_list (int need_fs_type) 
    10571057            me->me_type = ""; 
    10581058            me->me_type_malloced = 0; 
    10591059#ifdef GETFSTYP                 /* SVR3.  */ 
    1060             if (need_fs_type) 
    1061             { 
    1062                 struct statfs fsd; 
    1063                 char typebuf[FSTYPSZ]; 
     1060            struct statfs fsd; 
     1061            char typebuf[FSTYPSZ]; 
    10641062 
    1065                 if (statfs (me->me_mountdir, &fsd, sizeof (fsd), 0) != -1 
    1066                     && sysfs (GETFSTYP, fsd.f_fstyp, typebuf) != -1) 
    1067                 { 
    1068                     me->me_type = g_strdup (typebuf); 
    1069                     me->me_type_malloced = 1; 
    1070                 } 
     1063            if (statfs (me->me_mountdir, &fsd, sizeof (fsd), 0) != -1 
     1064                && sysfs (GETFSTYP, fsd.f_fstyp, typebuf) != -1) 
     1065            { 
     1066                me->me_type = g_strdup (typebuf); 
     1067                me->me_type_malloced = 1; 
    10711068            } 
    10721069#endif 
    10731070            me->me_dummy = ME_DUMMY (me->me_devname, me->me_type); 
    read_file_system_list (int need_fs_type) 
    12901287    } 
    12911288#endif /* MOUNTED_INTERIX_STATVFS */ 
    12921289 
    1293     (void) need_fs_type;        /* avoid argument-unused warning */ 
    1294  
    12951290    return g_slist_reverse (mount_list); 
    12961291 
    12971292  free_then_fail: 
    read_file_system_list (int need_fs_type) 
    13181313 */ 
    13191314 
    13201315static GSList * 
    1321 read_file_system_list (int need_fs_type, int all_fs) 
     1316read_file_system_list (void) 
    13221317{ 
    13231318    struct _disk_entry de; 
    13241319    struct statfs fs; 
    init_my_statfs (void) 
    16941689{ 
    16951690#ifdef HAVE_INFOMOUNT_LIST 
    16961691    free_my_statfs (); 
    1697     mc_mount_list = read_file_system_list (1); 
     1692    mc_mount_list = read_file_system_list (); 
    16981693#endif /* HAVE_INFOMOUNT_LIST */ 
    16991694} 
    17001695 
    my_statfs (struct my_statfs *myfs_stats, const char *path) 
    17541749        struct mount_entry *entry; 
    17551750    struct fs_usage fs_use; 
    17561751 
    1757     entry = read_file_system_list (0, 0); 
     1752    entry = read_file_system_list (); 
    17581753    if (entry != NULL) 
    17591754    { 
    17601755        get_fs_usage (entry->me_mountdir, NULL, &fs_use);