From dc640259adff6007d195fd4cc78dcf9829e5e6ee Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 29 May 2014 05:22:02 -0500 Subject: 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. --- toys/lsb/umount.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'toys/lsb') 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); -- cgit v1.2.3