From 5b294c93959f0811162e82137175ec7f2a9c5330 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 22 Aug 2018 21:58:18 +1000
Subject: Change settings dir


diff --git a/unix/uxmisc.c b/unix/uxmisc.c
index daa61a0..44cb7ea 100644
--- a/unix/uxmisc.c
+++ b/unix/uxmisc.c
@@ -334,7 +334,7 @@ char *make_dir_path(const char *path, mode_t mode)
         if (pos > 0) {
             prefix = dupprintf("%.*s", pos, path);
 
-            if (mkdir(prefix, mode) < 0 && errno != EEXIST) {
+            if (mkdir(prefix, mode) < 0 && errno != EEXIST && errno != EROFS) {
                 char *ret = dupprintf("%s: mkdir: %s",
                                       prefix, strerror(errno));
                 sfree(prefix);
diff --git a/unix/uxstore.c b/unix/uxstore.c
index 1580178..809c48b 100644
--- a/unix/uxstore.c
+++ b/unix/uxstore.c
@@ -105,6 +105,9 @@ static char *make_filename(int index, const char *subname)
 	    return dupstr(env);
 
         home = getenv("HOME");
+#ifdef __HAIKU__
+		home = dupprintf("%s/config/settings", home);
+#endif
 	pwd = getpwuid(getuid());
         if (pwd && pwd->pw_dir) {
             pwd_home = pwd->pw_dir;
-- 
2.16.4

