Fix umounting reporting exit status, Gentoo #239922.

This commit is contained in:
Roy Marples 2008-10-09 16:36:42 +00:00
parent 1a88a43aa5
commit 247766695c

View File

@ -1,6 +1,10 @@
# Copyright 2007-2008 Roy Marples <roy@marples.name> # Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license. # 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 # Handy function to handle all our unmounting needs
# mountinfo is a C program to actually find our mounts on our supported OS's # 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. # We rely on fuser being preset, so if it's not then we don't unmount anything.
@ -15,7 +19,10 @@ do_unmount()
fi fi
shift 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 # Unmounting a shared mount can unmount other mounts, so
# we need to check the mount is still valid # we need to check the mount is still valid
mountinfo --quiet "${mnt}" || continue mountinfo --quiet "${mnt}" || continue