summaryrefslogtreecommitdiff
path: root/src/chroot-tools
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-11-12 23:37:29 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-11-12 23:37:29 -0500
commite17b270bbfa29160beb34266533f5b2e2120041f (patch)
tree5b162d8e8695eff54c05cb7b0d50ffc8ef3c12d8 /src/chroot-tools
parent80125fc674b087b42791d2bd48a74bfa7edb2fe0 (diff)
librechroot: keep a lock on the CHROOTCOPY the whole time
Diffstat (limited to 'src/chroot-tools')
-rwxr-xr-xsrc/chroot-tools/librechroot7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot
index 07360d7..a5c5728 100755
--- a/src/chroot-tools/librechroot
+++ b/src/chroot-tools/librechroot
@@ -97,8 +97,6 @@ sync() {
exit 1
fi
- # Note that '9' is the same FD number as in mkarchroot
- lock_open_write 9 "$copydir" "Locking chroot copy '$copy'"
lock_open_read 8 "$rootdir" "Locking clean chroot"
stat_busy 'Creating clean working copy'
@@ -118,7 +116,6 @@ sync() {
stat_done
lock_close 8
- lock_close 9
}
update() {
@@ -187,6 +184,10 @@ main() {
exit 1
fi
+ # Keep this lock as long as we are running
+ # Note that '9' is the same FD number as in mkarchroot
+ lock_open_write 9 "$copydir" "Locking chroot copy '$copy'"
+
if [[ ! -d $rootdir ]]; then
libremkchroot -d "$CHROOTDIR" "$CHROOT"
fi