]> code.ossystems Code Review - openembedded-core.git/commitdiff
weston-init: Don't change XDG_RUNTIME_DIR if it already exists
authorTom Hochstein <tom.hochstein@nxp.com>
Thu, 9 Jun 2016 19:27:06 +0000 (14:27 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 12 Jun 2016 22:42:40 +0000 (23:42 +0100)
In the case that XDG_RUNTIME_DIR already exists, the mkdir --parents
at least does nothing, but the chmod could overwrite the desired
file mode settings.

Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-graphics/wayland/weston-init/weston-start

index 4b41576103ab51a4bc5ab0f58717e6facf7dbb54..5b7604f9302bdad0c19d279d71b9d1bc59152b84 100755 (executable)
@@ -65,8 +65,10 @@ fi
 
 if test -z "$XDG_RUNTIME_DIR"; then
     export XDG_RUNTIME_DIR=/run/user/`id -u`
-    mkdir --parents $XDG_RUNTIME_DIR
-    chmod 0700 $XDG_RUNTIME_DIR
+    if ! test -d "$XDG_RUNTIME_DIR"; then
+        mkdir --parents $XDG_RUNTIME_DIR
+        chmod 0700 $XDG_RUNTIME_DIR
+    fi
 fi
 
 exec openvt $openvt_args -- $launcher $weston_args --log=@LOCALSTATEDIR@/log/weston.log