summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-02-28 23:36:33 +0100
committerSven Eden <yamakuzure@gmx.net>2018-05-30 07:59:13 +0200
commit6e7275d6bc619d926ca7688326d42cd66cd3d6c0 (patch)
treeb2475328421d2e97293db8c9a2d1a58cd7c160de /src
parent55d5be46056010efe73e68b1bc3dd68402fcd1f9 (diff)
sd-bus: let's better not invade stdio territory when duplicating fds
Diffstat (limited to 'src')
-rw-r--r--src/libelogind/sd-bus/bus-message.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libelogind/sd-bus/bus-message.c b/src/libelogind/sd-bus/bus-message.c
index 5c91757aa..a0e4bc427 100644
--- a/src/libelogind/sd-bus/bus-message.c
+++ b/src/libelogind/sd-bus/bus-message.c
@@ -1400,7 +1400,7 @@ static int message_push_fd(sd_bus_message *m, int fd) {
if (copy < 0)
return -errno;
- f = reallocarray(m->fds, sizeof(int), m->n_fds + 1);
+ f = realloc(m->fds, sizeof(int) * (m->n_fds + 1));
if (!f) {
m->poisoned = true;
safe_close(copy);
@@ -2646,7 +2646,7 @@ _public_ int sd_bus_message_append_array_memfd(
if (r < 0)
return r;
- copy_fd = dup(memfd);
+ copy_fd = fcntl(memfd, F_DUPFD_CLOEXEC, 3);
if (copy_fd < 0)
return copy_fd;
@@ -2721,7 +2721,7 @@ _public_ int sd_bus_message_append_string_memfd(
if (r < 0)
return r;
- copy_fd = dup(memfd);
+ copy_fd = fcntl(memfd, FD_CLOEXEC, 3);
if (copy_fd < 0)
return copy_fd;