fix(common): Read mounts from /proc/self/mounts

Just in case the filesystem view is slightly different.
This commit is contained in:
Michael Marineau 2013-07-18 15:27:02 -07:00
parent ee3fc09057
commit b9257ee2a8

View File

@ -643,7 +643,7 @@ sub_mounts() {
# will). As such, we have to unmount in reverse order to cleanly
# unmount submounts (think /dev/pts and /dev).
awk -v path=$1 -v len="${#1}" \
'(substr($2, 1, len) == path) { print $2 }' /proc/mounts | \
'(substr($2, 1, len) == path) { print $2 }' /proc/self/mounts | \
tac | \
sed -e 's/\\040(deleted)$//'
# Hack(zbehan): If a bind mount's source is mysteriously removed,