summaryrefslogtreecommitdiff
path: root/src/libs6rc
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2024-10-02 18:01:13 +0000
committerLaurent Bercot <ska@appnovation.com>2024-10-02 18:01:13 +0000
commitc2df214e1cc4fea3b7df5a0f2116452a64900a24 (patch)
treec4da8885902c5f7294bc241a404e8baf52a6a0fa /src/libs6rc
parenta4e8c4473a214b783d05a1fd98309596943847f5 (diff)
downloads6-rc-c2df214e1cc4fea3b7df5a0f2116452a64900a24.tar.xz
Create instance subdir when copying template
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libs6rc')
-rw-r--r--src/libs6rc/s6rc_servicedir_internal.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libs6rc/s6rc_servicedir_internal.c b/src/libs6rc/s6rc_servicedir_internal.c
index 9c2e429..3735f2b 100644
--- a/src/libs6rc/s6rc_servicedir_internal.c
+++ b/src/libs6rc/s6rc_servicedir_internal.c
@@ -83,6 +83,11 @@ int s6rc_servicedir_copy_one (char const *src, char const *dst, s6_servicedir_de
{
if (errno != ENOENT || p->options & S6_SVFILE_MANDATORY) return 0 ;
}
+ if (!strcmp(p->name, "template"))
+ {
+ memcpy(dstfn + dstlen + 1, "instance", 9) ;
+ if (mkdir(dstfn, 0755) == -1 && errno != EEXIST) return 0 ;
+ }
break ;
default : return (errno = EDOM, 0) ;
}