From 0bfcf1a76204a92c908eed67b5a7659c416bd040 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 25 Sep 2013 19:33:28 +0200 Subject: [PATCH] Improve error message when $XDG_RUNTIME_DIR is not writable --- libi3/get_process_filename.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libi3/get_process_filename.c b/libi3/get_process_filename.c index 630e3d1c..941d4439 100644 --- a/libi3/get_process_filename.c +++ b/libi3/get_process_filename.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "libi3.h" @@ -35,6 +36,9 @@ char *get_process_filename(const char *prefix) { struct stat buf; if (stat(dir, &buf) != 0) { if (mkdir(dir, 0700) == -1) { + warn("Could not mkdir(%s)", dir); + errx(EXIT_FAILURE, "Check permissions of $XDG_RUNTIME_DIR = '%s'", + getenv("XDG_RUNTIME_DIR")); perror("mkdir()"); return NULL; } -- 2.39.5