diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-10-09 16:19:57 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-10-09 16:19:57 +0000 |
commit | 29f0382d7532eca906774d6b614a0e0a0a18447d (patch) | |
tree | 1b1138a1d1cffb5e73a49238558e5fdf4f1c5e0e | |
parent | 1874d378c2d9a107e98d73cc6f130add5fc9026a (diff) | |
download | s6-rc-0.3.0.0.tar.xz |
version: 0.3.0.0v0.3.0.0
-rw-r--r-- | doc/upgrade.html | 1 | ||||
-rw-r--r-- | src/libs6rc/s6rc_livedir_prefix.c | 7 |
2 files changed, 4 insertions, 4 deletions
diff --git a/doc/upgrade.html b/doc/upgrade.html index 23e4631..fa441d1 100644 --- a/doc/upgrade.html +++ b/doc/upgrade.html @@ -41,6 +41,7 @@ dependency bumped to 2.3.0.3. </li> dependency bumped to 2.6.1.1. </li> <li> New <tt>-p</tt> option to <a href="s6-rc-init.html">s6-rc-init</a> to allow using several live directories with the same scandir. </li> + <li> New command: <a href="s6-rc.html"><tt>s6-rc diff</tt></a>. </li> </ul> <h2> in 0.2.1.2 </h2> diff --git a/src/libs6rc/s6rc_livedir_prefix.c b/src/libs6rc/s6rc_livedir_prefix.c index 18a95fe..09fe263 100644 --- a/src/libs6rc/s6rc_livedir_prefix.c +++ b/src/libs6rc/s6rc_livedir_prefix.c @@ -8,13 +8,12 @@ ssize_t s6rc_livedir_prefix (char const *live, char *s, size_t n) { size_t llen = strlen(live) ; - size_t r ; + ssize_t r ; char sfn[llen + 8] ; memcpy(sfn, live, llen) ; memcpy(sfn + llen, "/prefix", 8) ; r = openreadnclose(sfn, s, n) ; - if (r < 0) return r ; - if (memchr(s, '/', r) || memchr(s, '\n', r)) - return (errno = EINVAL, -1) ; + if (r < 0) return errno == ENOENT ? 0 : r ; + if (memchr(s, '/', r) || memchr(s, '\n', r)) return (errno = EINVAL, -1) ; return r ; } |