summaryrefslogtreecommitdiff
path: root/src/libs6rc/s6rc_livedir_prefixsize.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-01-31 11:18:24 +0000
committerLaurent Bercot <ska@appnovation.com>2023-01-31 11:18:24 +0000
commitaa35510f1003777d309fa345ac373ba1b572c5ce (patch)
tree164de101c1e63b684df8bc3e4e350ba8b4877926 /src/libs6rc/s6rc_livedir_prefixsize.c
parent230393cd872421d26d37fa19378471a23a8ed466 (diff)
downloads6-rc-aa35510f1003777d309fa345ac373ba1b572c5ce.tar.xz
Don't hard depend on PATH_MAX; change servicedir file list
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libs6rc/s6rc_livedir_prefixsize.c')
-rw-r--r--src/libs6rc/s6rc_livedir_prefixsize.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libs6rc/s6rc_livedir_prefixsize.c b/src/libs6rc/s6rc_livedir_prefixsize.c
index d897fe6..ba14518 100644
--- a/src/libs6rc/s6rc_livedir_prefixsize.c
+++ b/src/libs6rc/s6rc_livedir_prefixsize.c
@@ -4,8 +4,11 @@
#include <string.h>
#include <sys/stat.h>
#include <errno.h>
+
#include <s6-rc/s6rc-utils.h>
+#include <skalibs/posixishard.h>
+
int s6rc_livedir_prefixsize (char const *live, size_t *n)
{
struct stat st ;
@@ -20,7 +23,7 @@ int s6rc_livedir_prefixsize (char const *live, size_t *n)
return 1 ;
}
if (!S_ISREG(st.st_mode)) return (errno = EINVAL, 0) ;
- if (st.st_size > PATH_MAX) return (errno = ENAMETOOLONG, 0) ;
+ if (st.st_size > SKALIBS_PATH_MAX) return (errno = ENAMETOOLONG, 0) ;
*n = st.st_size ;
return 1 ;
}