aboutsummaryrefslogtreecommitdiff
path: root/toys/lsb/umount.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-05-29 05:22:02 -0500
committerRob Landley <rob@landley.net>2014-05-29 05:22:02 -0500
commitdc640259adff6007d195fd4cc78dcf9829e5e6ee (patch)
tree97ab6eb6abb286a3d612b8aa86646cf655b1a1cf /toys/lsb/umount.c
parent55e9f35223e40f455b80671f25b412072d9af678 (diff)
downloadtoybox-dc640259adff6007d195fd4cc78dcf9829e5e6ee.tar.gz
Switch mtab_list to doubly linked so we can traverse in either order. Convert umount and df. Add dlist_terminate() to break lists for traversal in either direction.
Diffstat (limited to 'toys/lsb/umount.c')
-rw-r--r--toys/lsb/umount.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/toys/lsb/umount.c b/toys/lsb/umount.c
index cc40f144..d1a2c69d 100644
--- a/toys/lsb/umount.c
+++ b/toys/lsb/umount.c
@@ -119,7 +119,10 @@ void umount_main(void)
if (TT.t) arg_comma_collate(&typestr, TT.t);
// Loop through mounted filesystems
- for (mlsave = ml = xgetmountlist(0); ml; ml = ml->next) {
+ mlsave = xgetmountlist(0);
+ ml = ml->prev;
+
+ for (ml = dlist_terminate(mlsave); ml; ml = ml->prev) {
if (TT.t) {
char *type, *types = typestr;
int len, skip = strncmp(types, "no", 2);