summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libsystemd-bus/bus-message.c7
-rw-r--r--src/libsystemd-bus/test-bus-chat.c2
2 files changed, 1 insertions, 8 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index fb63a2d1cf..3081664091 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -1710,18 +1710,13 @@ int sd_bus_message_read_basic(sd_bus_message *m, char type, void *p) {
break;
case SD_BUS_TYPE_UNIX_FD: {
- int copy;
uint32_t j;
j = BUS_MESSAGE_BSWAP32(m, *(uint32_t*) q);
if (j >= m->n_fds)
return -EBADMSG;
- copy = fcntl(m->fds[j], F_DUPFD_CLOEXEC, 3);
- if (copy < 0)
- return -errno;
-
- *(int*) p = copy;
+ *(int*) p = m->fds[j];
break;
}
diff --git a/src/libsystemd-bus/test-bus-chat.c b/src/libsystemd-bus/test-bus-chat.c
index 533d78cc3b..371c7a7513 100644
--- a/src/libsystemd-bus/test-bus-chat.c
+++ b/src/libsystemd-bus/test-bus-chat.c
@@ -230,8 +230,6 @@ static int server(sd_bus *bus) {
goto fail;
}
- close_nointr_nofail(fd);
-
r = sd_bus_reply_method_return(bus, m, NULL);
if (r < 0) {
log_error("Failed to send reply: %s", strerror(-r));