From fa68e4a8bab90a575766c54a8ebca086d32e106c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 7 Feb 2015 14:37:55 -0500 Subject: xdg: Only try to flock if opening the lockfile worked --- .config/login.d/01_xdg.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.config/login.d/01_xdg.sh b/.config/login.d/01_xdg.sh index 07cea90..d415608 100644 --- a/.config/login.d/01_xdg.sh +++ b/.config/login.d/01_xdg.sh @@ -29,9 +29,10 @@ if [[ -z $XDG_RUNTIME_DIR ]] && type flock &>/dev/null; then fi if ! [[ /dev/fd/7 -ef "$XDG_CACHE_HOME/xdg-runtime-dir/.lock" ]]; then exec 7>"$XDG_CACHE_HOME/xdg-runtime-dir/.lock" - fi - if flock -sn 7; then - trap _diy_xdg_runtime_logout EXIT + if flock -sn 7; then + # Unfortunately this doesn't survive across exec(1). + trap _diy_xdg_runtime_logout EXIT + fi fi } _diy_xdg_runtime_logout() { -- cgit v1.1-4-g5e80