summary refs log tree commit diff
path: root/Functions/Calendar/calendar_add
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/Calendar/calendar_add')
-rw-r--r--Functions/Calendar/calendar_add6
1 files changed, 4 insertions, 2 deletions
diff --git a/Functions/Calendar/calendar_add b/Functions/Calendar/calendar_add
index ac5caecd7..eded25b2a 100644
--- a/Functions/Calendar/calendar_add
+++ b/Functions/Calendar/calendar_add
@@ -74,8 +74,10 @@ fi
 # Not needed but harmless if OS file locking is used.
 {
   if (( ! nolock )); then
-    if zmodload -F zsh/system b:zsystem && zsystem supports flock; then
-      zsystem flock $calendar
+    if zmodload -F zsh/system b:zsystem && zsystem supports flock &&
+      zsystem flock $calendar 2>/dev/null; then
+      # locked OK
+      :
     else
       calendar_lockfiles $calendar || exit 1
     fi