From 29f0382d7532eca906774d6b614a0e0a0a18447d Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 9 Oct 2017 16:19:57 +0000 Subject: version: 0.3.0.0 --- src/libs6rc/s6rc_livedir_prefix.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/libs6rc') 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 ; } -- cgit v1.2.3