aboutsummaryrefslogtreecommitdiff
path: root/toys/lsb
diff options
context:
space:
mode:
Diffstat (limited to 'toys/lsb')
-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);