diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2018-07-21 11:31:45 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2018-07-21 11:31:45 +0000 |
commit | c8a41df9c5b16dce89ae008a0187c6d606013b61 (patch) | |
tree | 1b065ab6cc74ec4522b51b30b13b9cdb25153b7d /src/libs6rc/s6rc_servicedir_unsupervise.c | |
parent | 1626bf78dd47a42ce37e984025a434a666fc5bbf (diff) | |
download | s6-rc-c8a41df9c5b16dce89ae008a0187c6d606013b61.tar.xz |
Adapt to skalibs-2.7.0.0
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 ; } } |