summaryrefslogtreecommitdiff
path: root/src/libs6/s6_svc_lock_take.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2020-10-26 09:33:06 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2020-10-26 09:33:06 +0000
commit65e6a29abd7413e21cc45470561e0eee2b24549e (patch)
tree58e4ca9beed37d897fdb337dee23c1ef0010d5ef /src/libs6/s6_svc_lock_take.c
parent7d992838c709b6caada3c0b6134a969ba185f42f (diff)
downloads6-65e6a29abd7413e21cc45470561e0eee2b24549e.tar.xz
Prepare for 2.9.2.1; add dangling symlink support
Diffstat (limited to 'src/libs6/s6_svc_lock_take.c')
-rw-r--r--src/libs6/s6_svc_lock_take.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libs6/s6_svc_lock_take.c b/src/libs6/s6_svc_lock_take.c
index 3dec282..a98aeab 100644
--- a/src/libs6/s6_svc_lock_take.c
+++ b/src/libs6/s6_svc_lock_take.c
@@ -6,6 +6,8 @@
#include <skalibs/djbunix.h>
#include <s6/s6-supervise.h>
+ /* XXX: does not work with dangling S6_SUPERVISE_CTLDIR symlinks */
+
int s6_svc_lock_take (char const *dir)
{
size_t dirlen = strlen(dir) ;
@@ -15,9 +17,9 @@ int s6_svc_lock_take (char const *dir)
memcpy(lock + dirlen, "/" S6_SUPERVISE_CTLDIR, sizeof(S6_SUPERVISE_CTLDIR) + 1) ;
if ((mkdir(lock, S_IRWXU) < 0) && (errno != EEXIST)) return -1 ;
memcpy(lock + dirlen + sizeof(S6_SUPERVISE_CTLDIR), "/lock", 6) ;
- fdlock = open_create(lock) ;
+ fdlock = open_createcoe(lock) ;
if (fdlock < 0) return -1 ;
- if (coe(fdlock) < 0 || lock_ex(fdlock) < 0)
+ if (lock_ex(fdlock) < 0)
{
fd_close(fdlock) ;
return -1 ;