Skip to content

Commit c41e8a6

Browse files
committed
Create XDG_CONFIG_HOME and XDG_CACHE_HOME directories
1 parent dae4e14 commit c41e8a6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/lib/delivery/delivery_init.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,18 @@ int delivery_init(struct Delivery *ctx, int render_mode) {
304304
char config_local[PATH_MAX];
305305
snprintf(config_local, sizeof(config_local), "%s/%s", ctx->storage.tmpdir, "config");
306306
setenv("XDG_CONFIG_HOME", config_local, 1);
307+
if (mkdirs(config_local, 0755)) {
308+
SYSERROR("%s: unable to create directory", config_local);
309+
// fall through because XDG doesn't _really_ need to be there
310+
}
307311

308312
char cache_local[PATH_MAX];
309313
snprintf(cache_local, sizeof(cache_local), "%s/%s", ctx->storage.tmpdir, "cache");
310314
setenv("XDG_CACHE_HOME", cache_local, 1);
315+
if (mkdirs(cache_local, 0755)) {
316+
SYSERROR("%s: unable to create directory", cache_local);
317+
// fall through because XDG doesn't _really_ need to be there
318+
}
311319

312320
// add tools to PATH
313321
char pathvar_tmp[STASIS_BUFSIZ];

0 commit comments

Comments
 (0)