From: Tobias Ulmer Date: Mon, 12 Nov 2018 18:08:12 +0000 (+0100) Subject: lock: provide instructions to fix a locked chroot X-Git-Tag: e2factory-2.3.18rc1~70 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=d278676cb7d8c670c246221bb934abf21f25b4c3;p=e2factory.git lock: provide instructions to fix a locked chroot Signed-off-by: Tobias Ulmer --- diff --git a/generic/lock.lua b/generic/lock.lua index 2fda76c..22be6a8 100644 --- a/generic/lock.lua +++ b/generic/lock.lua @@ -48,10 +48,13 @@ end -- @return True on success, false on error. -- @return Err object on failure. function lock.lock(l, dir) - local e = err.new("locking failed") - local rc, re = e2lib.mkdir(dir) - if not rc then + if not rc and err.eccmp(re, 'EEXIST') then + local e = err.new('chroot already in use!') + e:append('if this is an error, try rmdir %q', dir) + return false, e + elseif not rc then + local e = err.new("locking failed") return false, e:cat(re) end