bootmisc: only remove temp directory if umount is successful

Change the clean_run function to only remove the temp directory if the
umount was successful.

X-Gentoo-Bug: 561230
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=561230
This commit is contained in:
William Hubbs 2015-10-05 11:08:11 -05:00
parent 5f4f242036
commit 1558ad2b9e

View File

@ -136,8 +136,7 @@ clean_run()
dir=$(mktemp -d) dir=$(mktemp -d)
if [ -n "$dir" -a -d $dir -a -w $dir ]; then if [ -n "$dir" -a -d $dir -a -w $dir ]; then
mount --bind / $dir && rm -rf $dir/run/* || rc=1 mount --bind / $dir && rm -rf $dir/run/* || rc=1
umount $dir umount $dir && rmdir $dir
rm -rf $dir
else else
rc=1 rc=1
fi fi