From: Michael Stapelberg Date: Wed, 25 Sep 2013 17:33:28 +0000 (+0200) Subject: Improve error message when $XDG_RUNTIME_DIR is not writable X-Git-Tag: 4.7~51 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0bfcf1a76204a92c908eed67b5a7659c416bd040;p=i3%2Fi3 Improve error message when $XDG_RUNTIME_DIR is not writable --- 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; }