diff options
Diffstat (limited to 'src/libs6rc/s6rc_servicedir_unsupervise.c')
-rw-r--r-- | src/libs6rc/s6rc_servicedir_unsupervise.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libs6rc/s6rc_servicedir_unsupervise.c b/src/libs6rc/s6rc_servicedir_unsupervise.c index 5db127b..2d15a70 100644 --- a/src/libs6rc/s6rc_servicedir_unsupervise.c +++ b/src/libs6rc/s6rc_servicedir_unsupervise.c @@ -1,7 +1,9 @@ /* ISC license. */ +#include <errno.h> #include <string.h> #include <unistd.h> +#include <skalibs/posixplz.h> #include <s6/s6-supervise.h> #include <s6-rc/s6rc-servicedir.h> @@ -15,11 +17,13 @@ void s6rc_servicedir_unsupervise (char const *live, char const *prefix, char con memcpy(fn + livelen, "/scandir/", 9) ; memcpy(fn + livelen + 9, prefix, prefixlen) ; memcpy(fn + livelen + 9 + prefixlen, name, namelen + 1) ; - unlink(fn) ; + unlink_void(fn) ; if (!keepsupervisor) { + int e = errno ; memcpy(fn + livelen + 1, "servicedirs/", 12) ; memcpy(fn + livelen + 13, name, namelen + 1) ; s6_svc_writectl(fn, S6_SUPERVISE_CTLDIR, "x", 1) ; + errno = e ; } } |