mirror of
https://github.com/systemd/systemd.git
synced 2026-11-07 13:57:10 +00:00
sd-bus: fix invalid fcntl() argument and error handling
Fixes40164c2ceb. (cherry picked from commit4738dd120d) (cherry picked from commite8d4909b44) (cherry picked from commitf57474169d)
This commit is contained in:
1 parent
4dfe6ecd97
commit
ffba5ea2c5
1 file changed
+3
-3
@@ -2211,7 +2211,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)
|
||||
@@ -2284,9 +2284,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)
|
||||
|
||||
Reference in new issue
Block a user