projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gettimeofday: port recent C++ fix to Emacs
[gnulib.git]
/
lib
/
mountlist.c
diff --git
a/lib/mountlist.c
b/lib/mountlist.c
index
e61d37a
..
b839cd1
100644
(file)
--- a/
lib/mountlist.c
+++ b/
lib/mountlist.c
@@
-1,6
+1,6
@@
/* mountlist.c -- return a list of mounted file systems
/* mountlist.c -- return a list of mounted file systems
- Copyright (C) 1991-1992, 1997-201
2
Free Software Foundation, Inc.
+ Copyright (C) 1991-1992, 1997-201
3
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-128,8
+128,12
@@
# include <sys/mntent.h>
#endif
# include <sys/mntent.h>
#endif
+#ifndef HAVE_HASMNTOPT
+# define hasmntopt(mnt, opt) ((char *) 0)
+#endif
+
#undef MNT_IGNORE
#undef MNT_IGNORE
-#if
defined MNTOPT_IGNORE && defined HAVE_HASMNTOPT
+#if
def MNTOPT_IGNORE
# define MNT_IGNORE(M) hasmntopt (M, MNTOPT_IGNORE)
#else
# define MNT_IGNORE(M) 0
# define MNT_IGNORE(M) hasmntopt (M, MNTOPT_IGNORE)
#else
# define MNT_IGNORE(M) 0
@@
-156,7
+160,6
@@
/* for Linux 2.6/3.x */ \
|| strcmp (Fs_type, "debugfs") == 0 \
|| strcmp (Fs_type, "devpts") == 0 \
/* for Linux 2.6/3.x */ \
|| strcmp (Fs_type, "debugfs") == 0 \
|| strcmp (Fs_type, "devpts") == 0 \
- || strcmp (Fs_type, "devtmpfs") == 0 \
|| strcmp (Fs_type, "fusectl") == 0 \
|| strcmp (Fs_type, "mqueue") == 0 \
|| strcmp (Fs_type, "rpc_pipefs") == 0 \
|| strcmp (Fs_type, "fusectl") == 0 \
|| strcmp (Fs_type, "mqueue") == 0 \
|| strcmp (Fs_type, "rpc_pipefs") == 0 \
@@
-943,6
+946,7
@@
read_file_system_list (bool need_fs_type)
mtail = &me->me_next;
}
}
mtail = &me->me_next;
}
}
+ closedir (dirp);
}
#endif /* MOUNTED_INTERIX_STATVFS */
}
#endif /* MOUNTED_INTERIX_STATVFS */
@@
-958,11
+962,7
@@
read_file_system_list (bool need_fs_type)
while (mount_list)
{
me = mount_list->me_next;
while (mount_list)
{
me = mount_list->me_next;
- free (mount_list->me_devname);
- free (mount_list->me_mountdir);
- if (mount_list->me_type_malloced)
- free (mount_list->me_type);
- free (mount_list);
+ free_mount_entry (mount_list);
mount_list = me;
}
mount_list = me;
}
@@
-970,3
+970,14
@@
read_file_system_list (bool need_fs_type)
return NULL;
}
}
return NULL;
}
}
+
+/* Free a mount entry as returned from read_file_system_list (). */
+
+void free_mount_entry (struct mount_entry *me)
+{
+ free (me->me_devname);
+ free (me->me_mountdir);
+ if (me->me_type_malloced)
+ free (me->me_type);
+ free (me);
+}