diff options
author | Luke Shumaker <shumakl@purdue.edu> | 2015-12-06 23:40:42 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-12-06 23:45:57 -0500 |
commit | f189b197d568df8555a7de1e08f7f05665f708ba (patch) | |
tree | 28148f742f39a87bddbc13d97e8b119089e9aaf6 /.config | |
parent | 90972cbcc737530a8d8bf677fa7501da239d8ab2 (diff) |
minor fixes to the XDG_RUNTIME_DIR implementation
Diffstat (limited to '.config')
-rw-r--r-- | .config/login.d/02_xdg_runtime_dir.sh | 3 |
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")" |