aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2023-06-15 18:38:23 -0300
committerAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2023-10-19 10:56:54 +0200
commit2ce0f9de5e4da32eca0d217889a4a62f79feacd1 (patch)
tree57c1b77fe6a6a9811aed98aea900e4a7b1912a55
parent95e77e9a0bac0827e8b8efdb9565063566d22587 (diff)
misc.c: export the right paths when in user mode
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
-rw-r--r--src/shared/misc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/shared/misc.c b/src/shared/misc.c
index fbb50b59..11393d33 100644
--- a/src/shared/misc.c
+++ b/src/shared/misc.c
@@ -147,6 +147,7 @@ env_config(void)
char *path;
char *p;
char *e;
+ char *svcdir;
size_t l;
struct utsname uts;
FILE *fp;
@@ -187,8 +188,12 @@ env_config(void)
setenv("RC_VERSION", VERSION, 1);
setenv("RC_LIBEXECDIR", RC_LIBEXECDIR, 1);
- setenv("RC_SVCDIR", RC_SVCDIR, 1);
- setenv("RC_TMPDIR", RC_SVCDIR "/tmp", 1);
+ svcdir = rc_svcdir();
+ setenv("RC_SVCDIR", svcdir, 1);
+ xasprintf(&e, "%s/%s", svcdir, "/tmp");
+ setenv("RC_TMPDIR", e, 1);
+ free(e);
+ free(svcdir);
setenv("RC_BOOTLEVEL", RC_LEVEL_BOOT, 1);
e = rc_runlevel_get();
setenv("RC_RUNLEVEL", e, 1);