summaryrefslogtreecommitdiff
path: root/src/libs6rc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs6rc')
-rw-r--r--src/libs6rc/s6rc_servicedir_copy_online.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libs6rc/s6rc_servicedir_copy_online.c b/src/libs6rc/s6rc_servicedir_copy_online.c
index 6e14844..76d9e10 100644
--- a/src/libs6rc/s6rc_servicedir_copy_online.c
+++ b/src/libs6rc/s6rc_servicedir_copy_online.c
@@ -36,7 +36,12 @@ int s6rc_servicedir_copy_online (char const *src, char const *dst)
{
str_copy(dstfn + dstlen + 1, s6rc_servicedir_file_list[i].name) ;
str_copy(oldfn + dstlen + 5, s6rc_servicedir_file_list[i].name) ;
- if (rename(dstfn, oldfn) < 0) { e = errno ; goto errrename ; }
+ if (rename(dstfn, oldfn) < 0
+ && (errno != ENOENT || s6rc_servicedir_file_list[i].options & SVFILE_MANDATORY))
+ {
+ e = errno ;
+ goto errrename ;
+ }
}
n = i ;
while (i--)