summaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-02-07 14:37:55 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-02-07 14:41:28 -0500
commitfa68e4a8bab90a575766c54a8ebca086d32e106c (patch)
treebd4e2173961032d6243ea4f3242c0271619acc32 /.config
parente0004a60d46b7dc3eed863ab11129c2f3bac99fb (diff)
xdg: Only try to flock if opening the lockfile worked
Diffstat (limited to '.config')
-rw-r--r--.config/login.d/01_xdg.sh7
1 files 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() {