From 3b56d41ef579c18feafbf47d170a6ea4375beb6f Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 4 Nov 2025 22:23:28 +0000 Subject: Lots of work done, doesn't build yet, next commit will - alias subsystem moved to s6 - config subsystem deleted - new helpers subsystem, with a s6-frontend-helper-kill program - new s6f_equote function, to execline-quote an argv - started the adaptation to the new s6-rc functions, in progress --- src/libs6f/deps-lib/s6f | 1 + src/libs6f/s6f_equote.c | 24 ++++++++++++++++++++++++ src/libs6f/s6f_user_get_confdirs.c | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 src/libs6f/s6f_equote.c (limited to 'src/libs6f') diff --git a/src/libs6f/deps-lib/s6f b/src/libs6f/deps-lib/s6f index 464cc81..b1d1ddb 100644 --- a/src/libs6f/deps-lib/s6f +++ b/src/libs6f/deps-lib/s6f @@ -1,4 +1,5 @@ s6f_confdir_open.o +s6f_equote.o s6f_lock.o s6f_report_state_change.o s6f_user_get_confdirs.o diff --git a/src/libs6f/s6f_equote.c b/src/libs6f/s6f_equote.c new file mode 100644 index 0000000..41cef42 --- /dev/null +++ b/src/libs6f/s6f_equote.c @@ -0,0 +1,24 @@ +/* ISC license. */ + +#include + +#include "s6f.h" + +size_t s6f_equote_space (char const *const *argv, unsigned int argc) +{ + size_t l = 0 ; + for (unsigned int i = 0 ; i < argc ; i++) l += i + 2 + strlen(argv[i]) ; + return l ; +} + +unsigned int s6f_equote (char const **newargv, char const *const *argv, unsigned int argc, char *s) +{ + for (unsigned int i = 0 ; i < argc ; i++) + { + newargv[i] = s ; + *s++ = ' ' ; + s = stpcpy(s, argv[i]) + 1 ; + } + newargv[argc] = "" ; + return argc + 1 ; +} diff --git a/src/libs6f/s6f_user_get_confdirs.c b/src/libs6f/s6f_user_get_confdirs.c index b062650..5617bf9 100644 --- a/src/libs6f/s6f_user_get_confdirs.c +++ b/src/libs6f/s6f_user_get_confdirs.c @@ -68,7 +68,7 @@ void s6f_user_get_confdirs (s6f_confdirs *dirs, stralloc *storage) bootpos = storage->len ; if (!(confighome ? stralloc_cats(storage, confighome) : stralloc_cats(storage, home) && stralloc_cats(storage, "/.config")) - || !stralloc_cats(storage, "/s6-rc") + || !stralloc_cats(storage, "/s6-rc/compiled/current") || !stralloc_0(storage)) dienomem() ; stmppos = storage->len ; -- cgit v1.3.1