summaryrefslogtreecommitdiff
path: root/src/libstddjb
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-02-13 01:24:32 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2021-02-13 01:24:32 +0000
commit025e5ed74528cc2e8676268ad07b169949d89ae3 (patch)
tree7bcd42f49e5fbdf3d7afe93424b1e19fe8955e7d /src/libstddjb
parentc9cbf322db9b0617e38859b08e9ea90976bd6fcd (diff)
downloadskalibs-025e5ed74528cc2e8676268ad07b169949d89ae3.tar.xz
bugfix: ipc_bind_reuse_lock must ignore umask
Diffstat (limited to 'src/libstddjb')
-rw-r--r--src/libstddjb/ipc_bind_reuse_lock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstddjb/ipc_bind_reuse_lock.c b/src/libstddjb/ipc_bind_reuse_lock.c
index c872e44..09e440c 100644
--- a/src/libstddjb/ipc_bind_reuse_lock.c
+++ b/src/libstddjb/ipc_bind_reuse_lock.c
@@ -2,6 +2,7 @@
#include <skalibs/nonposix.h>
+#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
@@ -19,7 +20,7 @@ int ipc_bind_reuse_lock (int s, char const *p, int *fdlock)
char lockname[len + 6] ;
memcpy(lockname, p, len) ;
memcpy(lockname + len, ".lock", 6) ;
- fd = openc_create(lockname) ;
+ fd = open3(lockname, O_WRONLY | O_NONBLOCK | O_CREAT | O_CLOEXEC, 0600) ;
if (fd < 0) return -1 ;
r = fd_lock(fd, 1, 1) ;
if (r < 0) return -1 ;