sd-bus: fix invalid fcntl() argument and error handling

Fixes 40164c2ceb.

(cherry picked from commit 4738dd120dcd4e7ee9c0bb825a41633aad15b0bd)
This commit is contained in:
Yu Watanabe
2026-10-16 17:24:51 +01:00
committed by Luca Boccassi
parent de6055cf6a
commit e8d4909b44
+3 -3
View File
@@ -2210,7 +2210,7 @@ _public_ int sd_bus_message_append_array_memfd(
copy_fd = fcntl(memfd, F_DUPFD_CLOEXEC, 3);
if (copy_fd < 0)
return copy_fd;
return -errno;
r = memfd_get_size(memfd, &real_size);
if (r < 0)
@@ -2283,9 +2283,9 @@ _public_ int sd_bus_message_append_string_memfd(
if (r < 0)
return r;
copy_fd = fcntl(memfd, FD_CLOEXEC, 3);
copy_fd = fcntl(memfd, F_DUPFD_CLOEXEC, 3);
if (copy_fd < 0)
return copy_fd;
return -errno;
r = memfd_get_size(memfd, &real_size);
if (r < 0)