]> git.sur5r.net Git - i3/i3/commitdiff
Improve error message when $XDG_RUNTIME_DIR is not writable
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 25 Sep 2013 17:33:28 +0000 (19:33 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 25 Sep 2013 17:33:28 +0000 (19:33 +0200)
libi3/get_process_filename.c

index 630e3d1caa986e122f3e44d2f3811650ef375a5d..941d4439e75177161b09d3fdca06597a6aa8c24c 100644 (file)
@@ -15,6 +15,7 @@
 #include <sys/types.h>
 #include <pwd.h>
 #include <unistd.h>
+#include <err.h>
 
 #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;
                 }