summaryrefslogtreecommitdiff
path: root/src/libs6/s6_svc_writectl.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-11-22 14:02:46 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-11-22 14:02:46 +0000
commitb40d48d8fe2b7ff838d8e57482cd02f83987b7fd (patch)
treedb71abcb2b8a23443a42fcd431e7865c28177117 /src/libs6/s6_svc_writectl.c
parent321f8dd75df79a714b17a0f2cd16644ccc4febf9 (diff)
downloads6-b40d48d8fe2b7ff838d8e57482cd02f83987b7fd.tar.xz
Add SKALIBS_HASODIRECTORY support
Diffstat (limited to 'src/libs6/s6_svc_writectl.c')
-rw-r--r--src/libs6/s6_svc_writectl.c14
1 files changed, 13 insertions, 1 deletions
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 <skalibs/sysdeps.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
@@ -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
}