summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-10-09 10:38:37 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-10-09 10:38:37 +0000
commit7a6766da53fa06a02d818208c51801dd79e88a54 (patch)
tree1378bbe390e9cd8077f75efdd6ac1ee79be0bf80 /src
parentf9940bb7d1a6ce7d7772e8cbdbbd55a321cc5c18 (diff)
downloads6-rc-7a6766da53fa06a02d818208c51801dd79e88a54.tar.xz
Replace suffix with prefix
Diffstat (limited to 'src')
-rw-r--r--src/include/s6-rc/s6rc-utils.h4
-rw-r--r--src/libs6rc/deps-lib/s6rc4
-rw-r--r--src/libs6rc/s6rc_livedir_prefix.c (renamed from src/libs6rc/s6rc_livedir_suffix.c)7
-rw-r--r--src/libs6rc/s6rc_livedir_prefixsize.c (renamed from src/libs6rc/s6rc_livedir_suffixsize.c)4
-rw-r--r--src/libs6rc/s6rc_servicedir_manage.c18
-rw-r--r--src/libs6rc/s6rc_servicedir_unsupervise.c10
-rw-r--r--src/s6-rc/s6-rc-init.c22
-rw-r--r--src/s6-rc/s6-rc-update.c32
-rw-r--r--src/s6-rc/s6-rc.c50
9 files changed, 76 insertions, 75 deletions
diff --git a/src/include/s6-rc/s6rc-utils.h b/src/include/s6-rc/s6rc-utils.h
index ad1f1ef..b6cab0a 100644
--- a/src/include/s6-rc/s6rc-utils.h
+++ b/src/include/s6-rc/s6rc-utils.h
@@ -12,7 +12,7 @@ extern int s6rc_lock (char const *, int, int *, char const *, int, int *, int) ;
extern int s6rc_read_uint (char const *, unsigned int *) ;
extern int s6rc_sanitize_dir (stralloc *, char const *, size_t *) ;
-extern int s6rc_livedir_suffixsize (char const *, size_t *) ;
-extern ssize_t s6rc_livedir_suffix (char const *, char *, size_t) ;
+extern int s6rc_livedir_prefixsize (char const *, size_t *) ;
+extern ssize_t s6rc_livedir_prefix (char const *, char *, size_t) ;
#endif
diff --git a/src/libs6rc/deps-lib/s6rc b/src/libs6rc/deps-lib/s6rc
index 3768378..f42783b 100644
--- a/src/libs6rc/deps-lib/s6rc
+++ b/src/libs6rc/deps-lib/s6rc
@@ -5,8 +5,8 @@ s6rc_db_read.o
s6rc_db_read_sizes.o
s6rc_db_read_uint32.o
s6rc_graph_closure.o
-s6rc_livedir_suffix.o
-s6rc_livedir_suffixsize.o
+s6rc_livedir_prefix.o
+s6rc_livedir_prefixsize.o
s6rc_lock.o
s6rc_read_uint.o
s6rc_sanitize_dir.o
diff --git a/src/libs6rc/s6rc_livedir_suffix.c b/src/libs6rc/s6rc_livedir_prefix.c
index 98236cd..18a95fe 100644
--- a/src/libs6rc/s6rc_livedir_suffix.c
+++ b/src/libs6rc/s6rc_livedir_prefix.c
@@ -5,15 +5,16 @@
#include <skalibs/djbunix.h>
#include <s6-rc/s6rc-utils.h>
-ssize_t s6rc_livedir_suffix (char const *live, char *s, size_t n)
+ssize_t s6rc_livedir_prefix (char const *live, char *s, size_t n)
{
size_t llen = strlen(live) ;
size_t r ;
char sfn[llen + 8] ;
memcpy(sfn, live, llen) ;
- memcpy(sfn + llen, "/suffix", 8) ;
+ memcpy(sfn + llen, "/prefix", 8) ;
r = openreadnclose(sfn, s, n) ;
if (r < 0) return r ;
- if (memchr(s, '/', r)) return (errno = EINVAL, 0) ;
+ if (memchr(s, '/', r) || memchr(s, '\n', r))
+ return (errno = EINVAL, -1) ;
return r ;
}
diff --git a/src/libs6rc/s6rc_livedir_suffixsize.c b/src/libs6rc/s6rc_livedir_prefixsize.c
index b571dad..daa8481 100644
--- a/src/libs6rc/s6rc_livedir_suffixsize.c
+++ b/src/libs6rc/s6rc_livedir_prefixsize.c
@@ -5,13 +5,13 @@
#include <errno.h>
#include <s6-rc/s6rc-utils.h>
-int s6rc_livedir_suffixsize (char const *live, size_t *n)
+int s6rc_livedir_prefixsize (char const *live, size_t *n)
{
struct stat st ;
size_t llen = strlen(live) ;
char sfn[llen + 8] ;
memcpy(sfn, live, llen) ;
- memcpy(sfn + llen, "/suffix", 8) ;
+ memcpy(sfn + llen, "/prefix", 8) ;
if (stat(sfn, &st) < 0)
{
if (errno != ENOENT) return 0 ;
diff --git a/src/libs6rc/s6rc_servicedir_manage.c b/src/libs6rc/s6rc_servicedir_manage.c
index d39d045..940582c 100644
--- a/src/libs6rc/s6rc_servicedir_manage.c
+++ b/src/libs6rc/s6rc_servicedir_manage.c
@@ -13,24 +13,24 @@
#include <s6/ftrigw.h>
#include <s6-rc/s6rc-servicedir.h>
-static inline void rollback (char const *live, char const *suffix, char const *s, size_t len)
+static inline void rollback (char const *live, char const *prefix, char const *s, size_t len)
{
while (len)
{
size_t n = strlen(s) + 1 ;
- s6rc_servicedir_unsupervise(live, suffix, s, 0) ;
+ s6rc_servicedir_unsupervise(live, prefix, s, 0) ;
s += n ; len -= n ;
}
}
-int s6rc_servicedir_manage (char const *live, char const *suffix, tain_t const *deadline, tain_t *stamp)
+int s6rc_servicedir_manage (char const *live, char const *prefix, tain_t const *deadline, tain_t *stamp)
{
ftrigr_t a = FTRIGR_ZERO ;
stralloc newnames = STRALLOC_ZERO ;
genalloc ids = GENALLOC_ZERO ; /* uint16_t */
gid_t gid = getgid() ;
size_t livelen = strlen(live) ;
- size_t suffixlen = strlen(suffix) ;
+ size_t prefixlen = strlen(prefix) ;
int ok = 1 ;
int e = 0 ;
DIR *dir ;
@@ -53,7 +53,7 @@ int s6rc_servicedir_manage (char const *live, char const *suffix, tain_t const *
int r ;
uint16_t id ;
char srcfn[livelen + 20 + len] ;
- char dstfn[livelen + 10 + len + suffixlen] ;
+ char dstfn[livelen + 10 + prefixlen + len] ;
memcpy(srcfn, dirfn, livelen + 12) ;
srcfn[livelen + 12] = '/' ;
memcpy(srcfn + livelen + 13, d->d_name, len + 1) ;
@@ -76,8 +76,8 @@ int s6rc_servicedir_manage (char const *live, char const *suffix, tain_t const *
else s6_svc_lock_release(fdlock) ;
memcpy(dstfn, live, livelen) ;
memcpy(dstfn + livelen, "/scandir/", 9) ;
- memcpy(dstfn + livelen + 9, d->d_name, len) ;
- memcpy(dstfn + livelen + 9 + len, suffix, suffixlen + 1) ;
+ memcpy(dstfn + livelen + 9, prefix, prefixlen) ;
+ memcpy(dstfn + livelen + 9 + prefixlen, d->d_name, len + 1) ;
if (symlink(srcfn, dstfn) < 0)
{
if (!r || errno != EEXIST) goto err ;
@@ -87,7 +87,7 @@ int s6rc_servicedir_manage (char const *live, char const *suffix, tain_t const *
if (!stralloc_catb(&newnames, d->d_name, len + 1))
{
e = errno ;
- s6rc_servicedir_unsupervise(live, suffix, d->d_name, 0) ;
+ s6rc_servicedir_unsupervise(live, prefix, d->d_name, 0) ;
goto errn ;
}
}
@@ -127,7 +127,7 @@ int s6rc_servicedir_manage (char const *live, char const *suffix, tain_t const *
closederrn:
ftrigr_end(&a) ;
genalloc_free(uint16_t, &ids) ;
- rollback(live, suffix, newnames.s, newnames.len) ;
+ rollback(live, prefix, newnames.s, newnames.len) ;
stralloc_free(&newnames) ;
errno = e ;
return 0 ;
diff --git a/src/libs6rc/s6rc_servicedir_unsupervise.c b/src/libs6rc/s6rc_servicedir_unsupervise.c
index ed95152..5db127b 100644
--- a/src/libs6rc/s6rc_servicedir_unsupervise.c
+++ b/src/libs6rc/s6rc_servicedir_unsupervise.c
@@ -5,16 +5,16 @@
#include <s6/s6-supervise.h>
#include <s6-rc/s6rc-servicedir.h>
-void s6rc_servicedir_unsupervise (char const *live, char const *suffix, char const *name, int keepsupervisor)
+void s6rc_servicedir_unsupervise (char const *live, char const *prefix, char const *name, int keepsupervisor)
{
size_t livelen = strlen(live) ;
- size_t suffixlen = strlen(suffix) ;
+ size_t prefixlen = strlen(prefix) ;
size_t namelen = strlen(name) ;
- char fn[livelen + 14 + namelen + suffixlen] ;
+ char fn[livelen + 14 + prefixlen + namelen] ;
memcpy(fn, live, livelen) ;
memcpy(fn + livelen, "/scandir/", 9) ;
- memcpy(fn + livelen + 9, name, namelen) ;
- memcpy(fn + livelen + 9 + namelen, suffix, suffixlen + 1) ;
+ memcpy(fn + livelen + 9, prefix, prefixlen) ;
+ memcpy(fn + livelen + 9 + prefixlen, name, namelen + 1) ;
unlink(fn) ;
if (!keepsupervisor)
{
diff --git a/src/s6-rc/s6-rc-init.c b/src/s6-rc/s6-rc-init.c
index b1765c6..c618949 100644
--- a/src/s6-rc/s6-rc-init.c
+++ b/src/s6-rc/s6-rc-init.c
@@ -15,7 +15,7 @@
#include <s6-rc/config.h>
#include <s6-rc/s6rc.h>
-#define USAGE "s6-rc-init [ -c compiled ] [ -l live ] [ -s suffix ] [ -t timeout ] [ -b ] [ -d ] scandir"
+#define USAGE "s6-rc-init [ -c compiled ] [ -l live ] [ -p prefix ] [ -t timeout ] [ -b ] [ -d ] scandir"
#define dieusage() strerr_dieusage(100, USAGE)
#define dienomem() strerr_diefu1sys(111, "stralloc_catb")
@@ -38,7 +38,7 @@ int main (int argc, char const *const *argv)
size_t dirlen ;
char const *live = S6RC_LIVE_BASE ;
char const *compiled = S6RC_COMPILED_BASE ;
- char const *suffix = "" ;
+ char const *prefix = "" ;
int blocking = 0, deref = 0 ;
PROG = "s6-rc-init" ;
{
@@ -46,13 +46,13 @@ int main (int argc, char const *const *argv)
subgetopt_t l = SUBGETOPT_ZERO ;
for (;;)
{
- int opt = subgetopt_r(argc, argv, "c:l:s:t:bd", &l) ;
+ int opt = subgetopt_r(argc, argv, "c:l:p:t:bd", &l) ;
if (opt == -1) break ;
switch (opt)
{
case 'c' : compiled = l.arg ; break ;
case 'l' : live = l.arg ; break ;
- case 's' : suffix = l.arg ; break ;
+ case 'p' : prefix = l.arg ; break ;
case 't' : if (!uint0_scan(l.arg, &t)) dieusage() ; break ;
case 'b' : blocking = 1 ; break ;
case 'd' : deref = 1 ; break ;
@@ -71,8 +71,8 @@ int main (int argc, char const *const *argv)
strerr_dief2x(100, live, " is not an absolute path") ;
if (argv[0][0] != '/')
strerr_dief2x(100, argv[0], " is not an absolute path") ;
- if (strchr(suffix, '/'))
- strerr_dief1x(100, "suffix cannot contain a / character") ;
+ if (strchr(prefix, '/') || strchr(prefix, '\n'))
+ strerr_dief1x(100, "prefix cannot contain a / or a newline") ;
tain_now_g() ;
tain_add_g(&deadline, &tto) ;
@@ -133,12 +133,12 @@ int main (int argc, char const *const *argv)
}
- /* suffix */
+ /* prefix */
- if (suffix[0])
+ if (prefix[0])
{
- memcpy(lfn + llen + 1, "suffix", 7) ;
- if (!openwritenclose_unsafe(lfn, suffix, strlen(suffix)))
+ memcpy(lfn + llen + 1, "prefix", 7) ;
+ if (!openwritenclose_unsafe(lfn, prefix, strlen(prefix)))
{
cleanup() ;
strerr_diefu2sys(111, "write to ", lfn) ;
@@ -196,7 +196,7 @@ int main (int argc, char const *const *argv)
/* start the supervisors */
lfn[llen] = 0 ;
- ok = s6rc_servicedir_manage_g(lfn, suffix, &deadline) ;
+ ok = s6rc_servicedir_manage_g(lfn, prefix, &deadline) ;
if (!ok)
{
cleanup() ;
diff --git a/src/s6-rc/s6-rc-update.c b/src/s6-rc/s6-rc-update.c
index d9dce7c..c4d9510 100644
--- a/src/s6-rc/s6-rc-update.c
+++ b/src/s6-rc/s6-rc-update.c
@@ -31,7 +31,7 @@
#define USAGE "s6-rc-update [ -n ] [ -v verbosity ] [ -t timeout ] [ -l live ] [ -f conversion_file ] [ -b ] newdb"
#define dieusage() strerr_dieusage(100, USAGE)
#define dienomem() strerr_diefu1sys(111, "build string") ;
-#define NEWSUFFIX ":update:XXXXXX"
+#define NEWSUFFIX ":updated:XXXXXX"
static char const *live = S6RC_LIVE_BASE ;
static size_t livelen = sizeof(S6RC_LIVE_BASE) - 1 ;
@@ -323,7 +323,7 @@ static inline void rollback_servicedirs (char const *newlive, unsigned char cons
}
}
-static inline void make_new_livedir (unsigned char const *oldstate, s6rc_db_t const *olddb, unsigned char const *newstate, s6rc_db_t const *newdb, char const *newcompiled, unsigned int *invimage, char const *suffix, size_t suffixlen, stralloc *sa)
+static inline void make_new_livedir (unsigned char const *oldstate, s6rc_db_t const *olddb, unsigned char const *newstate, s6rc_db_t const *newdb, char const *newcompiled, unsigned int *invimage, char const *prefix, size_t prefixlen, stralloc *sa)
{
size_t tmpbase = satmp.len ;
size_t newclen = strlen(newcompiled) ;
@@ -348,8 +348,8 @@ static inline void make_new_livedir (unsigned char const *oldstate, s6rc_db_t co
satmp.len = tmplen ;
}
sa->len = newlen ;
- if (!stralloc_catb(sa, "/suffix", 8)) { e = errno ; goto err ; }
- if (!openwritenclose_unsafe(sa->s, suffix, suffixlen)) { e = errno ; goto err ; }
+ if (!stralloc_catb(sa, "/prefix", 8)) { e = errno ; goto err ; }
+ if (!openwritenclose_unsafe(sa->s, prefix, prefixlen)) { e = errno ; goto err ; }
sa->len = newlen ;
if (!stralloc_catb(sa, "/state", 7)) { e = errno ; goto err ; }
{
@@ -418,7 +418,7 @@ static inline void make_new_livedir (unsigned char const *oldstate, s6rc_db_t co
dienomem() ;
i = olddb->nlong ;
while (i--)
- s6rc_servicedir_unsupervise(sa->s, suffix, olddb->string + olddb->services[i].name, (oldstate[i] & 33) == 1) ;
+ s6rc_servicedir_unsupervise(sa->s, prefix, olddb->string + olddb->services[i].name, (oldstate[i] & 33) == 1) ;
rm_rf(sa->s) ;
sa->len = 0 ;
@@ -651,7 +651,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
int fdoldc, fdnewc ;
s6rc_db_t olddb, newdb ;
unsigned int oldn, newn ;
- size_t suffixlen = 0 ;
+ size_t prefixlen = 0 ;
char dbfn[livelen + 10] ;
tain_now_g() ;
@@ -668,10 +668,10 @@ int main (int argc, char const *const *argv, char const *const *envp)
strerr_diefu2sys(111, "take lock on ", argv[0]) ;
- /* Read the sizes of the suffix and compiled dbs */
+ /* Read the sizes of the prefix and compiled dbs */
- if (!s6rc_livedir_suffixsize(live, &suffixlen))
- strerr_diefu2sys(111, "read suffix size for ", live) ;
+ if (!s6rc_livedir_prefixsize(live, &prefixlen))
+ strerr_diefu2sys(111, "read prefix size for ", live) ;
fdoldc = open_readb(dbfn) ;
if (!s6rc_db_read_sizes(fdoldc, &olddb))
strerr_diefu3sys(111, "read ", dbfn, "/n") ;
@@ -698,7 +698,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
char newstringblob[newdb.stringlen] ;
unsigned char oldstate[oldn] ;
unsigned char newstate[newn] ;
- char suffix[suffixlen + 1] ;
+ char prefix[prefixlen + 1] ;
int r ;
olddb.services = oldserviceblob ;
@@ -711,12 +711,12 @@ int main (int argc, char const *const *argv, char const *const *envp)
newdb.string = newstringblob ;
- /* Read the suffix */
+ /* Read the prefix */
{
- ssize_t rr = s6rc_livedir_suffix(live, suffix, suffixlen) ;
- if (rr != suffixlen) strerr_diefu2sys(111, "read suffix for ", live) ;
- suffix[suffixlen] = 0 ;
+ ssize_t rr = s6rc_livedir_prefix(live, prefix, prefixlen) ;
+ if (rr != prefixlen) strerr_diefu2sys(111, "read prefix for ", live) ;
+ prefix[prefixlen] = 0 ;
}
@@ -805,8 +805,8 @@ int main (int argc, char const *const *argv, char const *const *envp)
if (verbosity >= 2)
strerr_warni1x("updating state and service directories") ;
- make_new_livedir(oldstate, &olddb, newstate, &newdb, argv[0], invimage, suffix, suffixlen, &sa) ;
- r = s6rc_servicedir_manage_g(live, suffix, &deadline) ;
+ make_new_livedir(oldstate, &olddb, newstate, &newdb, argv[0], invimage, prefix, prefixlen, &sa) ;
+ r = s6rc_servicedir_manage_g(live, prefix, &deadline) ;
if (!r) strerr_diefu2sys(111, "manage new service directories in ", live) ;
if (r & 2) strerr_warnw3x("s6-svscan not running on ", live, "/scandir") ;
diff --git a/src/s6-rc/s6-rc.c b/src/s6-rc/s6-rc.c
index 5fa8c4f..90ea8e2 100644
--- a/src/s6-rc/s6-rc.c
+++ b/src/s6-rc/s6-rc.c
@@ -42,8 +42,8 @@ static unsigned int n ;
static unsigned char *state ;
static unsigned int *pendingdeps ;
static tain_t deadline ;
-static size_t suffixlen ;
-static char *suffix ;
+static size_t prefixlen ;
+static char *prefix ;
static char dryrun[UINT_FMT] = "" ;
static inline void announce (void)
@@ -132,15 +132,15 @@ static pid_t start_longrun (unsigned int i, int h)
unsigned int m = 0 ;
char fmt[UINT32_FMT] ;
char vfmt[UINT_FMT] ;
- char servicefn[livelen + svdlen + suffixlen + 26] ;
+ char servicefn[livelen + prefixlen + svdlen + 26] ;
char const *newargv[7 + !!dryrun[0] * 6] ;
memcpy(servicefn, live, livelen) ;
memcpy(servicefn + livelen, "/scandir/", 9) ;
- memcpy(servicefn + livelen + 9, db->string + db->services[i].name, svdlen) ;
- memcpy(servicefn + livelen + 9 + svdlen, suffix, suffixlen) ;
+ memcpy(servicefn + livelen + 9, prefix, prefixlen) ;
+ memcpy(servicefn + livelen + 9 + prefixlen, db->string + db->services[i].name, svdlen) ;
if (h)
{
- memcpy(servicefn + livelen + 9 + svdlen + suffixlen, "/notification-fd", 17) ;
+ memcpy(servicefn + livelen + 9 + prefixlen + svdlen, "/notification-fd", 17) ;
if (access(servicefn, F_OK) < 0)
{
h = 2 ;
@@ -148,7 +148,7 @@ static pid_t start_longrun (unsigned int i, int h)
strerr_warnwu2sys("access ", servicefn) ;
}
}
- servicefn[livelen + 9 + svdlen + suffixlen] = 0 ;
+ servicefn[livelen + 9 + prefixlen + svdlen] = 0 ;
fmt[uint32_fmt(fmt, compute_timeout(i, !!h))] = 0 ;
vfmt[uint_fmt(vfmt, verbosity)] = 0 ;
if (dryrun[0])
@@ -175,12 +175,12 @@ static void success_longrun (unsigned int i, int h)
if (!dryrun[0])
{
size_t svdlen = strlen(db->string + db->services[i].name) ;
- char fn[livelen + svdlen + suffixlen + 15] ;
+ char fn[livelen + prefixlen + svdlen + 15] ;
memcpy(fn, live, livelen) ;
memcpy(fn + livelen, "/scandir/", 9) ;
- memcpy(fn + livelen + 9, db->string + db->services[i].name, svdlen) ;
- memcpy(fn + livelen + 9 + svdlen, suffix, suffixlen) ;
- memcpy(fn + livelen + 9 + svdlen + suffixlen, "/down", 6) ;
+ memcpy(fn + livelen + 9, prefix, prefixlen) ;
+ memcpy(fn + livelen + 9 + prefixlen, db->string + db->services[i].name, svdlen) ;
+ memcpy(fn + livelen + 9 + prefixlen + svdlen, "/down", 6) ;
if (h)
{
if (unlink(fn) < 0 && verbosity)
@@ -204,12 +204,12 @@ static void failure_longrun (unsigned int i, int h)
if (h && !dryrun[0])
{
size_t svdlen = strlen(db->string + db->services[i].name) ;
- char fn[livelen + svdlen + suffixlen + 10] ;
+ char fn[livelen + prefixlen + svdlen + 10] ;
char const *newargv[5] = { S6_EXTBINPREFIX "s6-svc", "-d", "--", fn, 0 } ;
memcpy(fn, live, livelen) ;
memcpy(fn + livelen, "/scandir/", 9) ;
- memcpy(fn + livelen + 9, db->string + db->services[i].name, svdlen) ;
- memcpy(fn + livelen + 9 + svdlen, suffix, suffixlen + 1) ;
+ memcpy(fn + livelen + 9, prefix, prefixlen) ;
+ memcpy(fn + livelen + 9 + prefixlen, db->string + db->services[i].name, svdlen + 1) ;
if (!child_spawn0(newargv[0], newargv, (char const *const *)environ))
strerr_warnwu2sys("spawn ", newargv[0]) ;
}
@@ -286,12 +286,12 @@ static void on_failure (unsigned int i, int h, int crashed, unsigned int code)
/*
static inline void kill_oneshots (void)
{
- char fn[livelen + S6RC_ONESHOT_RUNNER_LEN + suffixlen + 10] ;
+ char fn[livelen + prefixlen + S6RC_ONESHOT_RUNNER_LEN + 10] ;
char const *newargv[5] = { S6_EXTBINPREFIX "s6-svc", "-h", "--", fn, 0 } ;
memcpy(fn, live, livelen) ;
memcpy(fn + livelen, "/scandir/", 9) ;
- memcpy(fn + livelen + 9, S6RC_ONESHOT_RUNNER, S6RC_ONESHOT_RUNNER_LEN) ;
- memcpy(fn + livelen + 9 + S6RC_ONESHOT_RUNNER_LEN, suffix, suffixlen + 1) ;
+ memcpy(fn + livelen + 9, prefix, prefixlen) ;
+ memcpy(fn + livelen + 9 + prefixlen, S6RC_ONESHOT_RUNNER, S6RC_ONESHOT_RUNNER_LEN + 1) ;
if (!child_spawn0(newargv[0], newargv, (char const *const *)environ))
strerr_warnwu2sys("spawn ", newargv[0]) ;
}
@@ -494,8 +494,8 @@ int main (int argc, char const *const *argv)
/* Read the sizes of the suffix and compiled db */
- if (!s6rc_livedir_suffixsize(live, &suffixlen))
- strerr_diefu2sys(111, "read suffix size for ", live) ;
+ if (!s6rc_livedir_prefixsize(live, &prefixlen))
+ strerr_diefu2sys(111, "read prefix size for ", live) ;
fdcompiled = open_readb(dbfn) ;
if (!s6rc_db_read_sizes(fdcompiled, &dbblob))
strerr_diefu3sys(111, "read ", dbfn, "/n") ;
@@ -511,22 +511,22 @@ int main (int argc, char const *const *argv)
uint32_t depsblob[dbblob.ndeps << 1] ;
char stringblob[dbblob.stringlen] ;
unsigned char stateblob[n] ;
- char suffixblob[suffixlen + 1] ;
+ char prefixblob[prefixlen + 1] ;
dbblob.services = serviceblob ;
dbblob.argvs = argvblob ;
dbblob.deps = depsblob ;
dbblob.string = stringblob ;
state = stateblob ;
- suffix = suffixblob ;
+ prefix = prefixblob ;
- /* Read the suffix */
+ /* Read the prefix */
{
- ssize_t r = s6rc_livedir_suffix(live, suffix, suffixlen) ;
- if (r != suffixlen) strerr_diefu2sys(111, "read suffix for ", live) ;
- suffix[suffixlen] = 0 ;
+ ssize_t r = s6rc_livedir_prefix(live, prefix, prefixlen) ;
+ if (r != prefixlen) strerr_diefu2sys(111, "read prefix for ", live) ;
+ prefix[prefixlen] = 0 ;
}