From b40d48d8fe2b7ff838d8e57482cd02f83987b7fd Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 22 Nov 2017 14:02:46 +0000 Subject: Add SKALIBS_HASODIRECTORY support --- src/libs6/s6_svc_writectl.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libs6/s6_svc_writectl.c b/src/libs6/s6_svc_writectl.c index c522923..11eaf0e 100644 --- a/src/libs6/s6_svc_writectl.c +++ b/src/libs6/s6_svc_writectl.c @@ -1,5 +1,6 @@ /* ISC license. */ +#include #include #include #include @@ -21,7 +22,10 @@ int s6_svc_writectl (char const *service, char const *subdir, char const *s, siz r = s6_svc_write(fn, s, len) ; if (r != -2) return r ; - /* Now we need to investigate what went wrong... */ +#ifdef SKALIBS_HASODIRECTORY + + /* Investigate what went wrong */ + { int fd, fdsub ; fd = open(service, O_RDONLY | O_DIRECTORY) ; @@ -32,4 +36,12 @@ int s6_svc_writectl (char const *service, char const *subdir, char const *s, siz fd_close(fdsub) ; return -2 ; } + +#else + + /* Too bad, get a better system */ + + return -2 ; + +#endif } -- cgit v1.2.3