summaryrefslogtreecommitdiffstats
path: root/src/aclk/mqtt_websockets/ws_client.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/aclk/mqtt_websockets/ws_client.c (renamed from mqtt_websockets/src/ws_client.c)4
1 files changed, 2 insertions, 2 deletions
diff --git a/mqtt_websockets/src/ws_client.c b/src/aclk/mqtt_websockets/ws_client.c
index 47f633e74..240e889ca 100644
--- a/mqtt_websockets/src/ws_client.c
+++ b/src/aclk/mqtt_websockets/ws_client.c
@@ -72,7 +72,7 @@ ws_client *ws_client_new(size_t buf_size, char **host, mqtt_wss_log_ctx_t log)
if (!client->buf_to_mqtt)
goto cleanup_2;
- client->entropy_fd = open(ENTROPY_SOURCE, O_RDONLY);
+ client->entropy_fd = open(ENTROPY_SOURCE, O_RDONLY | O_CLOEXEC);
if (client->entropy_fd < 1) {
ERROR("Error opening entropy source \"" ENTROPY_SOURCE "\". Reason: \"%s\"", strerror(errno));
goto cleanup_3;
@@ -164,7 +164,7 @@ static int ws_client_get_nonce(ws_client *client, char *dest, unsigned int size)
// we do not need crypto secure random here
// it's just used for protocol negotiation
int rd;
- int f = open(RAND_SRC, O_RDONLY);
+ int f = open(RAND_SRC, O_RDONLY | O_CLOEXEC);
if (f < 0) {
ERROR("Error opening \"%s\". Err: \"%s\"", RAND_SRC, strerror(errno));
return -2;