From b79e808944675040ec2cbc2534592a5d4e62477b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 31 Aug 2014 14:10:26 +0200 Subject: [PATCH 1/1] libubus: mark ubus socket with close-on-exec Signed-off-by: Felix Fietkau --- libubus-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libubus-io.c b/libubus-io.c index 31dad27..3280e41 100644 --- a/libubus-io.c +++ b/libubus-io.c @@ -379,7 +379,7 @@ int ubus_reconnect(struct ubus_context *ctx, const char *path) goto out_free; ret = UBUS_STATUS_OK; - fcntl(ctx->sock.fd, F_SETFL, fcntl(ctx->sock.fd, F_GETFL) | O_NONBLOCK); + fcntl(ctx->sock.fd, F_SETFL, fcntl(ctx->sock.fd, F_GETFL) | O_NONBLOCK | O_CLOEXEC); ubus_refresh_state(ctx); -- 2.11.0