diff options
author | Roger Leigh <rleigh@debian.org> | 2009-12-21 21:18:23 +0000 |
---|---|---|
committer | Roger Leigh <rleigh@debian.org> | 2009-12-21 21:18:23 +0000 |
commit | 096ee1edd69091e673c09b54618ecdc38fa2fab4 (patch) | |
tree | 2dca4713bca57bc8a2a02b0e2ea47de59291c651 | |
parent | 3775225ff516fdb2c2c2af5d75da7d71d049bcbc (diff) | |
download | schroot-096ee1edd69091e673c09b54618ecdc38fa2fab4.tar.gz |
sbuild::chroot_block_device: Create session file when using union
-rw-r--r-- | sbuild/sbuild-chroot-block-device.cc | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/sbuild/sbuild-chroot-block-device.cc b/sbuild/sbuild-chroot-block-device.cc index fa8bbbe6..542d73ec 100644 --- a/sbuild/sbuild-chroot-block-device.cc +++ b/sbuild/sbuild-chroot-block-device.cc @@ -136,31 +136,31 @@ chroot_block_device::setup_lock (chroot::setup_type type, chroot_facet_union::const_ptr puni (base->get_facet<chroot_facet_union>()); assert(puni); - if (puni->get_union_configured()) - return; + if (!puni->get_union_configured()) #endif - - sbuild::device_lock dlock(this->device); - if (lock) - { - try - { - dlock.set_lock(lock::LOCK_EXCLUSIVE, 15); - } - catch (sbuild::lock::error const& e) - { - throw error(get_device(), DEVICE_LOCK, e); - } - } - else { - try + sbuild::device_lock dlock(this->device); + if (lock) { - dlock.unset_lock(); + try + { + dlock.set_lock(lock::LOCK_EXCLUSIVE, 15); + } + catch (sbuild::lock::error const& e) + { + throw error(get_device(), DEVICE_LOCK, e); + } } - catch (sbuild::lock::error const& e) + else { - throw error(get_device(), DEVICE_UNLOCK, e); + try + { + dlock.unset_lock(); + } + catch (sbuild::lock::error const& e) + { + throw error(get_device(), DEVICE_UNLOCK, e); + } } } } |