summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <shumakl@purdue.edu>2015-12-06 23:40:42 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-12-06 23:45:57 -0500
commitf189b197d568df8555a7de1e08f7f05665f708ba (patch)
tree28148f742f39a87bddbc13d97e8b119089e9aaf6
parent90972cbcc737530a8d8bf677fa7501da239d8ab2 (diff)
minor fixes to the XDG_RUNTIME_DIR implementation
-rw-r--r--.config/login.d/02_xdg_runtime_dir.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/.config/login.d/02_xdg_runtime_dir.sh b/.config/login.d/02_xdg_runtime_dir.sh
index 6db58af..6e3e4ad 100644
--- a/.config/login.d/02_xdg_runtime_dir.sh
+++ b/.config/login.d/02_xdg_runtime_dir.sh
@@ -5,11 +5,11 @@ if [ -z "$XDG_RUNTIME_DIR" ] && type flock &>/dev/null; then
_diy_xdg_runtime_login() {
export XDG_RUNTIME_DIR="$XDG_CACHE_HOME/xdg-runtime-dir/$HOSTNAME"
if ! [ /dev/fd/7 -ef "$XDG_CACHE_HOME/xdg-runtime-dir/.lock" ]; then
+ mkdir -p -- "$XDG_CACHE_HOME/xdg-runtime-dir"
exec 7>"$XDG_CACHE_HOME/xdg-runtime-dir/.lock"
if flock -xn 7; then
if [ ! -d "$XDG_RUNTIME_DIR" ]; then
local tmp="$(mktemp -d --tmpdir -- "${USER}@${HOSTNAME}-runtime.XXXXXXXXXX")"
- mkdir -p -- "$XDG_CACHE_HOME/xdg-runtime-dir"
ln -sfT -- "$tmp" "$XDG_RUNTIME_DIR"
fi
# Unfortunately this doesn't survive across exec(1).
@@ -19,7 +19,6 @@ if [ -z "$XDG_RUNTIME_DIR" ] && type flock &>/dev/null; then
fi
}
_diy_xdg_runtime_logout() {
- exec 7>&-
exec 7>"$XDG_CACHE_HOME/xdg-runtime-dir/.lock"
if flock -xn 7; then
rm -rf -- "$(readlink "$XDG_RUNTIME_DIR")"