summaryrefslogtreecommitdiff
path: root/lib/mountlist.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-07-25 14:54:42 +0000
committerJim Meyering <jim@meyering.net>1998-07-25 14:54:42 +0000
commitbb3fca40db7abb3ea7be513cd459872a13b1e56c (patch)
treefee6ee34bba5823893efa03e203c58c1953b3b06 /lib/mountlist.c
parent91c40bd4992f7e9194394547100cf339f85393ab (diff)
downloadcoreutils-bb3fca40db7abb3ea7be513cd459872a13b1e56c.tar.xz
(read_filesystem_list) [MOUNTED_GETMNTINFO]: Use fsp_to_string.
(fsp_to_string): Don't xmalloc return value (yet).
Diffstat (limited to 'lib/mountlist.c')
-rw-r--r--lib/mountlist.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/mountlist.c b/lib/mountlist.c
index e2f953b73..2759974cd 100644
--- a/lib/mountlist.c
+++ b/lib/mountlist.c
@@ -256,7 +256,7 @@ static char *
fsp_to_string (const struct statfs *fsp)
{
# if defined HAVE_F_FSTYPENAME_IN_STATFS
- return xstrdup (fsp->f_fstypename);
+ return fsp->f_fstypename;
# else
return fstype_to_string (fsp->f_type);
# endif
@@ -377,23 +377,14 @@ read_filesystem_list (int need_fs_type, int all_fs)
return NULL;
for (; entries-- > 0; fsp++)
{
- if (all_fs < 0)
- {
-# ifdef HAVE_F_FSTYPENAME_IN_STATFS
- if (REMOTE_FS_TYPE (fsp->f_fstypename))
- continue;
-# else
-# ifdef MOUNT_NFS
- if (REMOTE_FS_TYPE (fstype_to_string (fsp->f_type)))
- continue;
-# endif
-# endif
- }
+ char *fs_type = fsp_to_string (fsp);
+ if (all_fs < 0 && REMOTE_FS_TYPE (fs_type))
+ continue;
me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
me->me_devname = xstrdup (fsp->f_mntfromname);
me->me_mountdir = xstrdup (fsp->f_mntonname);
- me->me_type = fsp_to_string (fsp);
+ me->me_type = fs_type;
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
/* Add to the linked list. */