diff options
author | наб <[email protected]> | 2021-05-14 04:17:31 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2021-06-08 16:09:22 -0700 |
commit | b828cf1d01d291de2ab43f207f243898c763f7a2 (patch) | |
tree | d8cd5562645b0fda2659d3fac89aa9108db4344d /cmd | |
parent | 75b4cbf62590c23fac3667537961a2a75fdc2cc3 (diff) |
zed-functions.sh: zed_lock(): don't truncate lock
By appending instead of truncating, we can lock on any file (with write
permissions) instead of only dedicated lock files, since the locking
process itself no longer alters the file in any way
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #12042
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/zed/zed.d/zed-functions.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/zed/zed.d/zed-functions.sh b/cmd/zed/zed.d/zed-functions.sh index c4ed5aa8a..9f8531d73 100644 --- a/cmd/zed/zed.d/zed-functions.sh +++ b/cmd/zed/zed.d/zed-functions.sh @@ -126,7 +126,7 @@ zed_lock() # Obtain a lock on the file bound to the given file descriptor. # - eval "exec ${fd}> '${lockfile}'" + eval "exec ${fd}>> '${lockfile}'" if ! err="$(flock --exclusive "${fd}" 2>&1)"; then zed_log_err "failed to lock \"${lockfile}\": ${err}" fi |