diff options
author | Mike Westerhof <mwester@dls.net> | 2008-03-22 23:46:30 +0000 |
---|---|---|
committer | Mike Westerhof <mwester@dls.net> | 2008-03-22 23:46:30 +0000 |
commit | 000108573470503cad4447b8f5c8bd026712dd5f (patch) | |
tree | 8aa9f24d1c1e10d6e47db507b8abc19eb2b1dc1f /packages/slugos-init/files | |
parent | 2dfc59aecfead8b3670643cdb06cedf23de923c0 (diff) |
sysconf: make sure temporary partition is unmounted even in event of error.
Diffstat (limited to 'packages/slugos-init/files')
-rw-r--r-- | packages/slugos-init/files/sysconf | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/slugos-init/files/sysconf b/packages/slugos-init/files/sysconf index 84a14af550..57a69b7643 100644 --- a/packages/slugos-init/files/sysconf +++ b/packages/slugos-init/files/sysconf @@ -665,6 +665,8 @@ sysconf_restore(){ # mkdir "$saved" || { sysconf_restore_error "$ffsdir" "$saved: failed to create temporary directory" + umount "$ffsdir" && rmdir "$ffsdir" || + echo "$0: $ffsdir: temporary directory cleanup failed" >&2 return 1 } # @@ -678,6 +680,8 @@ sysconf_restore(){ ) || { rm -rf "$saved" sysconf_restore_error "$ffsdir" "$saved: cpio -i failed" + umount "$ffsdir" && rmdir "$ffsdir" || + echo "$0: $ffsdir: temporary directory cleanup failed" >&2 return 1 } # either there must be no 'diff' files or it must |