diff --git a/obexd/src/main.c b/obexd/src/main.c
index 61a06b2..80645f8 100644
--- a/obexd/src/main.c
+++ b/obexd/src/main.c
#include "obexd.h"
#include "server.h"
-#define DEFAULT_ROOT_PATH "/tmp"
-
#define DEFAULT_CAP_FILE CONFIGDIR "/capability.xml"
static GMainLoop *main_loop = NULL;
"Specify root folder location. Both absolute "
"and relative can be used, but relative paths "
"are assumed to be relative to user $HOME "
- "folder", "PATH" },
+ "folder. Default $XDG_CACHE_HOME", "PATH" },
{ "root-setup", 'S', 0, G_OPTION_ARG_STRING, &option_root_setup,
"Root folder setup script", "SCRIPT" },
{ "symlinks", 'l', 0, G_OPTION_ARG_NONE, &option_symlinks,
exit(EXIT_FAILURE);
}
- if (option_root == NULL)
- option_root = g_strdup(DEFAULT_ROOT_PATH);
+ if (option_root == NULL) {
+ option_root = g_build_filename(g_get_user_cache_dir(), "obexd",
+ NULL);
+ g_mkdir_with_parents(option_root, 0700);
+ }
if (option_root[0] != '/') {
char *old_root = option_root, *home = getenv("HOME");