mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-09 14:38:59 +02:00
fix(gstack-memorable): name an unwritable state directory when the lock cannot be created
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
9cabb7cdbb
commit
7f4943c438
@@ -102,7 +102,7 @@ _lock_release() {
|
||||
LOCK_HELD=0
|
||||
}
|
||||
_lock_acquire() {
|
||||
mkdir -p "$STATE_DIR/locks" 2>/dev/null || { _err "cannot create $STATE_DIR/locks"; return 5; }
|
||||
mkdir -p "$STATE_DIR/locks" 2>/dev/null || { _err "cannot create $STATE_DIR/locks (state directory not writable; nothing can be recorded there)"; return 5; }
|
||||
local tries=0 mtime now stale judged moved owner_pid
|
||||
while ! mkdir "$LOCK_DIR" 2>/dev/null; do
|
||||
tries=$((tries + 1))
|
||||
|
||||
Reference in New Issue
Block a user