summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEric Koegel <eric.koegel@gmail.com>2017-05-04 02:25:32 +0300
committerEric Koegel <eric.koegel@gmail.com>2017-05-04 02:29:10 +0300
commitcebe706bed6f88cdb3f4c3015b29db8c755af713 (patch)
tree921f8adf637d4b6403b506ae215b8aeae54b8a37 /tools
parentffe60ba5e9edbfcffc1c5f66986dbcd8fbf1af77 (diff)
downloadConsoleKit2-cebe706bed6f88cdb3f4c3015b29db8c755af713.tar.gz
Handle runtimedir not being created/set
For: https://github.com/ConsoleKit2/ConsoleKit2/issues/74
Diffstat (limited to 'tools')
-rw-r--r--tools/ck-launch-session.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/ck-launch-session.c b/tools/ck-launch-session.c
index 427e07b..a102998 100644
--- a/tools/ck-launch-session.c
+++ b/tools/ck-launch-session.c
@@ -58,7 +58,7 @@ main (int argc, char **argv)
/* Setup for i18n */
setlocale(LC_ALL, "");
-
+
#ifdef ENABLE_NLS
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
@@ -68,6 +68,7 @@ main (int argc, char **argv)
if (ckc != NULL) {
dbus_error_init (&error);
if (ck_connector_open_session (ckc, &error)) {
+ const char *runtime_dir = NULL;
pid = fork ();
switch (pid) {
case -1:
@@ -77,8 +78,10 @@ main (int argc, char **argv)
setenv ("XDG_SESSION_COOKIE",
ck_connector_get_cookie (ckc), 1);
- setenv ("XDG_RUNTIME_DIR",
- ck_connector_get_runtime_dir (ckc, &error), 1);
+ runtime_dir = ck_connector_get_runtime_dir (ckc, &error);
+ if (runtime_dir != NULL) {
+ setenv ("XDG_RUNTIME_DIR", runtime_dir, 1);
+ }
break;
default:
waitpid (pid, &status, 0);