diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | package/deps.mak | 11 | ||||
| -rw-r--r-- | src/libs6f/deps-lib/s6f | 4 | ||||
| -rw-r--r-- | src/libs6f/s6f_user_get_confdirs.c | 21 | ||||
| -rw-r--r-- | src/s6/deps-exe/s6 | 1 |
5 files changed, 26 insertions, 12 deletions
@@ -2,6 +2,7 @@ *.o *.lo /config.mak +/libs6f.a.xyzzy /src/include/s6-frontend/config.h /s6-frontend-* /s6 diff --git a/package/deps.mak b/package/deps.mak index be5493e..c9d5970 100644 --- a/package/deps.mak +++ b/package/deps.mak @@ -7,7 +7,7 @@ src/alias/s6-frontend-alias-chpst.o src/alias/s6-frontend-alias-chpst.lo: src/al src/alias/s6-frontend-alias-sv.o src/alias/s6-frontend-alias-sv.lo: src/alias/s6-frontend-alias-sv.c src/alias/s6-frontend-alias.o src/alias/s6-frontend-alias.lo: src/alias/s6-frontend-alias.c src/include/s6-frontend/config.h src/config/s6-frontend-config-preprocess.o src/config/s6-frontend-config-preprocess.lo: src/config/s6-frontend-config-preprocess.c -src/libs6f/s6f_user_get_confdirs.o src/libs6f/s6f_user_get_confdirs.lo: src/libs6f/s6f_user_get_confdirs.c src/include-local/s6-internal.h +src/libs6f/s6f_user_get_confdirs.o src/libs6f/s6f_user_get_confdirs.lo: src/libs6f/s6f_user_get_confdirs.c src/include-local/s6f.h src/s6/help.o src/s6/help.lo: src/s6/help.c src/s6/s6-internal.h src/s6/process.o src/s6/process.lo: src/s6/process.c src/s6/s6-internal.h src/s6/process_kill.o src/s6/process_kill.lo: src/s6/process_kill.c src/s6/s6-internal.h @@ -30,8 +30,13 @@ s6-frontend-alias-sv: EXTRA_LIBS := ${SPAWN_LIB} s6-frontend-alias-sv: src/alias/s6-frontend-alias-sv.o -ls6 -lskarnet s6-frontend-config-preprocess: EXTRA_LIBS := s6-frontend-config-preprocess: src/config/s6-frontend-config-preprocess.o -lskarnet +ifeq ($(strip $(STATIC_LIBS_ARE_PIC)),) +libs6f.a.xyzzy: src/libs6f/s6f_user_get_confdirs.o ${LIBNSSS} +else +libs6f.a.xyzzy:src/libs6f/s6f_user_get_confdirs.lo ${LIBNSSS} +endif s6f: EXTRA_LIBS := s6f: src/libs6f/s6f.o src/libs6f/s6f_user_get_confdirs.o s6: EXTRA_LIBS := -s6: src/s6/s6.o src/s6/help.o src/s6/util.o src/s6/process.o src/s6/process_kill.o src/s6/process_restart.o src/s6/process_start.o src/s6/process_status.o src/s6/process_stop.o src/s6/service.o src/s6/service_start.o src/s6/service_status.o src/s6/service_stop.o -ls6 -lskarnet -INTERNAL_LIBS := +s6: src/s6/s6.o src/s6/help.o src/s6/util.o src/s6/process.o src/s6/process_kill.o src/s6/process_restart.o src/s6/process_start.o src/s6/process_status.o src/s6/process_stop.o src/s6/service.o src/s6/service_start.o src/s6/service_status.o src/s6/service_stop.o libs6f.a.xyzzy -ls6 -lskarnet +INTERNAL_LIBS := libs6f.a.xyzzy diff --git a/src/libs6f/deps-lib/s6f b/src/libs6f/deps-lib/s6f new file mode 100644 index 0000000..c792b84 --- /dev/null +++ b/src/libs6f/deps-lib/s6f @@ -0,0 +1,4 @@ +s6f_user_get_confdirs.o +${LIBNSSS} +-lskarnet +${MAYBEPTHREAD_LIB} diff --git a/src/libs6f/s6f_user_get_confdirs.c b/src/libs6f/s6f_user_get_confdirs.c index 57e6451..badbea0 100644 --- a/src/libs6f/s6f_user_get_confdirs.c +++ b/src/libs6f/s6f_user_get_confdirs.c @@ -10,7 +10,7 @@ #include <skalibs/strerr.h> #include <skalibs/stralloc.h> -#include "s6-internal.h" +#include "s6f.h" #define dienomem() strerr_diefu1sys(111, "allocate memory") @@ -27,9 +27,10 @@ void s6f_user_get_confdirs (s6f_confdirs *dirs, stralloc *storage) if (!datahome || !confighome) { - *home = getenv("HOME") ; + home = getenv("HOME") ; if (!home) { + uid_t uid = getuid() ; errno = 0 ; pw = getpwuid(uid) ; if (!pw) @@ -46,7 +47,7 @@ void s6f_user_get_confdirs (s6f_confdirs *dirs, stralloc *storage) if (homelen) { memcpy(homeinstack, pw->pw_dir, homelen) ; - homestack[homelen] = 0 ; + homeinstack[homelen] = 0 ; home = homeinstack ; } @@ -60,18 +61,20 @@ void s6f_user_get_confdirs (s6f_confdirs *dirs, stralloc *storage) || !stralloc_cats(storage, "/s6-rc") || !stralloc_0(storage)) dienomem() ; - repopos = storage.len ; + repopos = storage->len ; if (!(datahome ? stralloc_cats(storage, datahome) : stralloc_cats(storage, home) && stralloc_cats(storage, "/.local/share")) || !stralloc_cats(storage, "/s6-frontend/repository") - || !stralloc_0(storage)) dienomem ; + || !stralloc_0(storage)) dienomem() ; - bootpos = storage.len ; + bootpos = storage->len ; if (!(confighome ? stralloc_cats(storage, confighome) : stralloc_cats(storage, home) && stralloc_cats(storage, "/.config")) || !stralloc_cats(storage, "/s6-rc") - || !stralloc_0(storage)) dienomem ; + || !stralloc_0(storage)) dienomem() ; /* Don't add to storage past this point */ - dirs->scan = storage.s + scanpos ; - + dirs->scan = storage->s + scanpos ; + dirs->live = storage->s + livepos ; + dirs->repo = storage->s + repopos ; + dirs->boot = storage->s + bootpos ; } diff --git a/src/s6/deps-exe/s6 b/src/s6/deps-exe/s6 index d408a3a..e3cd3b7 100644 --- a/src/s6/deps-exe/s6 +++ b/src/s6/deps-exe/s6 @@ -10,5 +10,6 @@ service.o service_start.o service_status.o service_stop.o +libs6f.a.xyzzy -ls6 -lskarnet |
