diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2015-06-10 20:30:51 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2015-06-10 20:30:51 +0000 |
commit | bca445464cefca632c355011f29c102a3c4bc4e3 (patch) | |
tree | aa12d0ab62766be345020b6eeb7fe48f6286841d | |
parent | 80774990f5bba0c76e7bbcff40ec17199cbe0bc9 (diff) | |
download | s6-rc-bca445464cefca632c355011f29c102a3c4bc4e3.tar.xz |
s6-rc-init bugfix: add a down file for loggers
-rw-r--r-- | src/s6-rc/s6-rc-init.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/s6-rc/s6-rc-init.c b/src/s6-rc/s6-rc-init.c index 3ea1a23..b61d73e 100644 --- a/src/s6-rc/s6-rc-init.c +++ b/src/s6-rc/s6-rc-init.c @@ -188,7 +188,7 @@ int main (int argc, char const *const *argv) unsigned int i = 0 ; int r ; uint16 ids[ndirs] ; - char srcfn[llen + 20 + maxlen] ; + char srcfn[llen + 23 + maxlen] ; char dstfn[llen + 9 + sizeof(S6_SVSCAN_CTLDIR "/control") + maxlen] ; rewinddir(dir) ; byte_copy(srcfn, llen + 12, lfn) ; @@ -222,6 +222,17 @@ int main (int argc, char const *const *argv) strerr_diefu2sys(111, "touch ", srcfn) ; } close(r) ; + byte_copy(srcfn + llen + 14 + thislen, 9, "log/down") ; + r = open_trunc(srcfn) ; + if (r < 0) + { + if (errno != ENOENT) + { + cleanup(live) ; + strerr_diefu2sys(111, "touch ", srcfn) ; + } + } + else close(r) ; byte_copy(srcfn + llen + 14 + thislen, 6, "event") ; if (!ftrigw_fifodir_make(srcfn, gid, 0)) { |