about summary refs log tree commit diff
path: root/Functions/Calendar/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/Calendar/calendar')
-rw-r--r--Functions/Calendar/calendar8
1 files changed, 5 insertions, 3 deletions
diff --git a/Functions/Calendar/calendar b/Functions/Calendar/calendar
index bbfa9ffb0..e4cdff8e4 100644
--- a/Functions/Calendar/calendar
+++ b/Functions/Calendar/calendar
@@ -266,9 +266,11 @@ chmod 600 $mycmds
     # Attempt to lock both $donefile and $calendar.
     # Don't lock $newfile; we've tried our best to make
     # the name unique.
-    if zmodload -F zsh/system b:zsystem && zsystem supports flock; then
-      zsystem flock $calendar
-      zsystem flock $donefile
+    if zmodload -F zsh/system b:zsystem && zsystem supports flock &&
+      zsystem flock $calendar 2>/dev/null &&
+      zsystem flock $donefile 2>/dev/null; then
+      # locked OK
+      :
     else
       calendar_lockfiles $calendar $donefile || exit 1
     fi