summaryrefslogtreecommitdiff
path: root/ctdb/common
diff options
context:
space:
mode:
Diffstat (limited to 'ctdb/common')
-rw-r--r--ctdb/common/pidfile.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ctdb/common/pidfile.c b/ctdb/common/pidfile.c
index b3f29e3f07d..51c0c25c92e 100644
--- a/ctdb/common/pidfile.c
+++ b/ctdb/common/pidfile.c
@@ -22,6 +22,8 @@
#include <talloc.h>
+#include "lib/util/blocking.h"
+
#include "common/pidfile.h"
struct pidfile_context {
@@ -61,6 +63,12 @@ int pidfile_create(TALLOC_CTX *mem_ctx, const char *pidfile,
goto fail;
}
+ if (! set_close_on_exec(fd)) {
+ close(fd);
+ ret = EIO;
+ goto fail;
+ }
+
pid_ctx->fd = fd;
lck = (struct flock) {