diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2010-04-13 16:28:21 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2010-04-13 16:28:21 +0000 |
commit | c30b038a422cb918f5a80115ef9c1541cedf3dea (patch) | |
tree | 8000b872bbd2a7650f23b7ffe4cbf5550e45ed76 /Functions | |
parent | 1094863b35d48a93de5cc20bc65121a2712db2d2 (diff) | |
download | zsh-c30b038a422cb918f5a80115ef9c1541cedf3dea.tar.gz zsh-c30b038a422cb918f5a80115ef9c1541cedf3dea.tar.xz zsh-c30b038a422cb918f5a80115ef9c1541cedf3dea.zip |
unposted: calendar system updates:
allow file locking to fall back; don't need dcop for kdialog
Diffstat (limited to 'Functions')
-rw-r--r-- | Functions/Calendar/calendar | 8 | ||||
-rw-r--r-- | Functions/Calendar/calendar_add | 6 | ||||
-rw-r--r-- | Functions/Calendar/calendar_edit | 6 | ||||
-rw-r--r-- | Functions/Calendar/calendar_show | 2 | ||||
-rw-r--r-- | Functions/Calendar/calendar_sort | 6 |
5 files changed, 18 insertions, 10 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 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 diff --git a/Functions/Calendar/calendar_edit b/Functions/Calendar/calendar_edit index 430c3b2e9..ae8885048 100644 --- a/Functions/Calendar/calendar_edit +++ b/Functions/Calendar/calendar_edit @@ -20,8 +20,10 @@ zstyle -s ':datetime:calendar:' calendar-file calendar || calendar=~/calendar # start of block for following always to clear up lockfiles. # Not needed but harmless if OS file locking is used. { - 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 diff --git a/Functions/Calendar/calendar_show b/Functions/Calendar/calendar_show index 5be589945..0e236fd17 100644 --- a/Functions/Calendar/calendar_show +++ b/Functions/Calendar/calendar_show @@ -13,7 +13,7 @@ zmodload -i zsh/parameter || return # HERE: this should be configurable and we should be able to do # better if xmessage isn't available, e.g. wish. if [[ -n $DISPLAY && $start -eq $stop ]]; then - if [[ -n ${commands[kdialog]} && -n $KDE_SESSION_UID ]] && dcop >&/dev/null + if [[ -n ${commands[kdialog]} && -n $KDE_SESSION_UID ]] then # We're in a KDE session, most probably. # Simple: diff --git a/Functions/Calendar/calendar_sort b/Functions/Calendar/calendar_sort index 4911e34a2..0eddd12c7 100644 --- a/Functions/Calendar/calendar_sort +++ b/Functions/Calendar/calendar_sort @@ -16,8 +16,10 @@ zstyle -s ':datetime:calendar:' calendar-file calendar || calendar=~/calendar # start of block for following always to clear up lockfiles. # Not needed but harmless if OS file locking is used. { - 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; then + # locked OK + : else calendar_lockfiles $calendar || exit 1 fi |