summaryrefslogtreecommitdiff
path: root/minecctl/misc-commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'minecctl/misc-commands.c')
-rw-r--r--minecctl/misc-commands.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/minecctl/misc-commands.c b/minecctl/misc-commands.c
index db9b937..3ad9792 100644
--- a/minecctl/misc-commands.c
+++ b/minecctl/misc-commands.c
@@ -69,6 +69,7 @@ static bool write_cfg_file(int dfd, const char *name,
static bool find_user_service(int xfd, const char *service)
{
_cleanup_close_ int dfd = -1;
+ _cleanup_free_ char *dpath = NULL;
/* FIXME: Make this a macro, make paths #defines */
char sub_path[STRLEN("systemd/user/") + strlen(service) + 1];
char etc_path[STRLEN("/etc/systemd/user/") + strlen(service) + 1];
@@ -98,11 +99,11 @@ static bool find_user_service(int xfd, const char *service)
return true;
}
- dfd = open_xdg_data_dir(false);
+ dfd = open_xdg_data_dir(false, &dpath);
if (dfd >= 0) {
if (faccessat(dfd, sub_path, R_OK, 0) == 0) {
info("User service %s already installed in "
- "$XDG_DATA_HOME/systemd/user/", service);
+ "%s/systemd/user/", service, dpath);
return true;
}
}
@@ -187,7 +188,7 @@ bool do_init(_unused_ struct cfg *cfg)
_cleanup_close_ int xdfd = -1;
_cleanup_close_ int mdfd = -1;
- xcfd = open_xdg_cfg_dir(true);
+ xcfd = open_xdg_cfg_dir(true, NULL);
if (xcfd < 0)
return false;
@@ -215,7 +216,7 @@ bool do_init(_unused_ struct cfg *cfg)
___examples_minecproxy_service_len))
return false;
- xdfd = open_xdg_data_dir(true);
+ xdfd = open_xdg_data_dir(true, NULL);
if (xdfd < 0)
return false;