]> git.sur5r.net Git - i3/i3/blobdiff - libi3/get_process_filename.c
Merge branch 'release-4.16.1'
[i3/i3] / libi3 / get_process_filename.c
index 630e3d1caa986e122f3e44d2f3811650ef375a5d..7e2ecbd24a51cf00195d836a4309d596deac3488 100644 (file)
@@ -2,9 +2,11 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
+#include "libi3.h"
+
 #include <assert.h>
 #include <stdint.h>
 #include <stdlib.h>
@@ -15,8 +17,7 @@
 #include <sys/types.h>
 #include <pwd.h>
 #include <unistd.h>
-
-#include "libi3.h"
+#include <err.h>
 
 /*
  * Returns the name of a temporary file with the specified prefix.
@@ -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;
                 }