aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-05-07 15:35:23 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-05-07 15:35:23 -0400
commit9468c81718046af0a0b32c492bee359a98e2e8e9 (patch)
tree4f151439534564691ed77b1af76cdfbe6b9bba77 /src
parenta9f3ed63573693836d7bab50403c23fb5bf75507 (diff)
downloadstasis-9468c81718046af0a0b32c492bee359a98e2e8e9.tar.gz
Create XDG_CONFIG_HOME and XDG_CACHE_HOME directoriesuse-stasis-bufsiz
Diffstat (limited to 'src')
-rw-r--r--src/lib/delivery/delivery_init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/delivery/delivery_init.c b/src/lib/delivery/delivery_init.c
index ec05a0f..024815b 100644
--- a/src/lib/delivery/delivery_init.c
+++ b/src/lib/delivery/delivery_init.c
@@ -294,10 +294,18 @@ int delivery_init(struct Delivery *ctx, int render_mode) {
char config_local[PATH_MAX];
snprintf(config_local, sizeof(config_local), "%s/%s", ctx->storage.tmpdir, "config");
setenv("XDG_CONFIG_HOME", config_local, 1);
+ if (mkdirs(config_local, 0755)) {
+ SYSERROR("%s: unable to create directory", config_local);
+ // fall through because XDG doesn't _really_ need to be there
+ }
char cache_local[PATH_MAX];
snprintf(cache_local, sizeof(cache_local), "%s/%s", ctx->storage.tmpdir, "cache");
setenv("XDG_CACHE_HOME", cache_local, 1);
+ if (mkdirs(cache_local, 0755)) {
+ SYSERROR("%s: unable to create directory", cache_local);
+ // fall through because XDG doesn't _really_ need to be there
+ }
// add tools to PATH
char pathvar_tmp[STASIS_BUFSIZ];