summaryrefslogtreecommitdiff
path: root/src/libs6rc/s6rc_servicedir_unsupervise.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-10-09 10:38:37 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-10-09 10:38:37 +0000
commit7a6766da53fa06a02d818208c51801dd79e88a54 (patch)
tree1378bbe390e9cd8077f75efdd6ac1ee79be0bf80 /src/libs6rc/s6rc_servicedir_unsupervise.c
parentf9940bb7d1a6ce7d7772e8cbdbbd55a321cc5c18 (diff)
downloads6-rc-7a6766da53fa06a02d818208c51801dd79e88a54.tar.xz
Replace suffix with prefix
Diffstat (limited to 'src/libs6rc/s6rc_servicedir_unsupervise.c')
-rw-r--r--src/libs6rc/s6rc_servicedir_unsupervise.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libs6rc/s6rc_servicedir_unsupervise.c b/src/libs6rc/s6rc_servicedir_unsupervise.c
index ed95152..5db127b 100644
--- a/src/libs6rc/s6rc_servicedir_unsupervise.c
+++ b/src/libs6rc/s6rc_servicedir_unsupervise.c
@@ -5,16 +5,16 @@
#include <s6/s6-supervise.h>
#include <s6-rc/s6rc-servicedir.h>
-void s6rc_servicedir_unsupervise (char const *live, char const *suffix, char const *name, int keepsupervisor)
+void s6rc_servicedir_unsupervise (char const *live, char const *prefix, char const *name, int keepsupervisor)
{
size_t livelen = strlen(live) ;
- size_t suffixlen = strlen(suffix) ;
+ size_t prefixlen = strlen(prefix) ;
size_t namelen = strlen(name) ;
- char fn[livelen + 14 + namelen + suffixlen] ;
+ char fn[livelen + 14 + prefixlen + namelen] ;
memcpy(fn, live, livelen) ;
memcpy(fn + livelen, "/scandir/", 9) ;
- memcpy(fn + livelen + 9, name, namelen) ;
- memcpy(fn + livelen + 9 + namelen, suffix, suffixlen + 1) ;
+ memcpy(fn + livelen + 9, prefix, prefixlen) ;
+ memcpy(fn + livelen + 9 + prefixlen, name, namelen + 1) ;
unlink(fn) ;
if (!keepsupervisor)
{