From e17b270bbfa29160beb34266533f5b2e2120041f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 12 Nov 2012 23:37:29 -0500 Subject: librechroot: keep a lock on the CHROOTCOPY the whole time --- src/chroot-tools/librechroot | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') 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 -- cgit v1.2.2