summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-12-07 15:57:39 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-12-07 15:57:39 +0000
commit4870ccf23a36c5ccf4a6a4cc1ff6f086a028ed7d (patch)
tree3cbe20b887f85b136690ecfb03ded99d85277350 /src
parentde1f9afb36117743bd6efb009e6ebf01b34c93f4 (diff)
downloads6-rc-4870ccf23a36c5ccf4a6a4cc1ff6f086a028ed7d.tar.xz
Fix (hopefully) the two remaining bugs in s6-rc-update...
Diffstat (limited to 'src')
-rw-r--r--src/libs6rc/s6rc_livedir_create.c4
-rw-r--r--src/s6-rc/s6-rc-update.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libs6rc/s6rc_livedir_create.c b/src/libs6rc/s6rc_livedir_create.c
index 4454111..e1fd896 100644
--- a/src/libs6rc/s6rc_livedir_create.c
+++ b/src/libs6rc/s6rc_livedir_create.c
@@ -32,8 +32,8 @@ int s6rc_livedir_create (stralloc *sa, char const *live, char const *suffix, cha
if (!openwritenclose_unsafe(sa->s + sabase, prefix, strlen(prefix))) goto delerr ;
strcpy(sa->s + newlen, "state") ;
if (!openwritenclose_unsafe(sa->s + sabase, (char const *)state, statelen)) goto delerr ;
- sa->len = newlen ;
- sa->s[newlen] = 0 ;
+ sa->len = newlen-1 ;
+ sa->s[newlen-1] = 0 ;
*dirlen = ddirlen ;
return 1 ;
diff --git a/src/s6-rc/s6-rc-update.c b/src/s6-rc/s6-rc-update.c
index 0313f1e..cf17eaf 100644
--- a/src/s6-rc/s6-rc-update.c
+++ b/src/s6-rc/s6-rc-update.c
@@ -327,7 +327,7 @@ static inline void make_new_livedir (unsigned char const *oldstate, s6rc_db_t co
size_t dirlen, pos, newlen, sdlen ;
size_t newclen = strlen(newcompiled) ;
unsigned int i = newdb->nlong + newdb->nshort ;
- if (sareadlink(sa, live) < 0 || !stralloc_0(sa)) strerr_diefu2sys(111, "readlink ", live) ;
+ if (sarealpath(sa, live) < 0 || !stralloc_0(sa)) strerr_diefu2sys(111, "sarealpath ", live) ;
pos = sa->len ;
{
ssize_t r ;