diff options
author | Luke Shumaker <shumakl@purdue.edu> | 2015-12-06 23:40:42 -0500 |
---|---|---|
committer | Luke Shumaker <shumakl@purdue.edu> | 2015-12-06 23:40:42 -0500 |
commit | 802bd75210b982c7bfb0159db1172827925c8e3f (patch) | |
tree | 405b785e9b6597ad9bbf40ccdbc03d3fe7fc927c /.config/login.d | |
parent | 989314a3677f520de767ceff5137a7f13c22a204 (diff) |
minor fixes to the XDG_RUNTIME_DIR implementation
Diffstat (limited to '.config/login.d')
-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")" |