summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-11-07 00:23:16 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-11-07 00:23:16 +0000
commit501b54278cf3965d9d38dba81870c4ea371d20a3 (patch)
treeabcdb112d1210663453c11e3b4fb9ce631482f38 /src
parentc41e85c8dbaf105ca24191ea2c04d65f281d5f75 (diff)
downloads6-rc-501b54278cf3965d9d38dba81870c4ea371d20a3.tar.xz
s6-rc-init bugfix: don't use satmp.s after cleanup() (thanks Eric Le Bihan)
Diffstat (limited to 'src')
-rw-r--r--src/s6-rc/s6-rc-init.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/s6-rc/s6-rc-init.c b/src/s6-rc/s6-rc-init.c
index 2043c99..e7ef023 100644
--- a/src/s6-rc/s6-rc-init.c
+++ b/src/s6-rc/s6-rc-init.c
@@ -90,8 +90,10 @@ int main (int argc, char const *const *argv)
if (mkdir(satmp.s, 0755) < 0) strerr_diefu2sys(111, "mkdir ", satmp.s) ;
if (!s6rc_lock(satmp.s, 2, &fdlock, 0, 0, 0))
{
+ char tmp[satmp.len] ;
+ byte_copy(tmp, satmp.len, satmp.s) ;
cleanup() ;
- strerr_diefu2sys(111, "take lock on ", satmp.s) ;
+ strerr_diefu2sys(111, "take lock on ", tmp) ;
}
byte_copy(lfn, llen, satmp.s) ;
lfn[llen] = 0 ;