aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-10-09 16:36:42 +0000
committerRoy Marples <roy@marples.name>2008-10-09 16:36:42 +0000
commit247766695cd7c5e8d83dff72f7eb7e6578bf57b8 (patch)
treeee50aeb633cbe97523dfd24303535bb187b72516
parent1a88a43aa50fc80d141b4ea5e654fce6b78c7665 (diff)
Fix umounting reporting exit status, Gentoo #239922.
-rw-r--r--sh/rc-mount.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/sh/rc-mount.sh b/sh/rc-mount.sh
index 68aa4c86..135f2f5c 100644
--- a/sh/rc-mount.sh
+++ b/sh/rc-mount.sh
@@ -1,6 +1,10 @@
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
+# Declare this here so that no formatting doesn't affect the embedded newline
+__IFS="
+"
+
# Handy function to handle all our unmounting needs
# mountinfo is a C program to actually find our mounts on our supported OS's
# We rely on fuser being preset, so if it's not then we don't unmount anything.
@@ -15,7 +19,10 @@ do_unmount()
fi
shift
- mountinfo "$@" | while read mnt; do
+ local IFS="$__IFS"
+ set -- $(mountinfo "$@")
+ unset IFS
+ for mnt; do
# Unmounting a shared mount can unmount other mounts, so
# we need to check the mount is still valid
mountinfo --quiet "${mnt}" || continue