diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-12-19 13:20:30 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-12-19 15:00:59 +0100 |
commit | 3401477982d09e0c9815ae5a69e56f43f187967e (patch) | |
tree | fdf3ce225df76b9e643835928dc29aeef02a51fc /src/machine | |
parent | tree-wide: change initialization to use EBADF instead of EBADFD (diff) | |
download | systemd-3401477982d09e0c9815ae5a69e56f43f187967e.tar.xz systemd-3401477982d09e0c9815ae5a69e56f43f187967e.zip |
tree-wide: use -EBADF also in pipe initializers
In some places, initialization is dropped when unnecesary.
Diffstat (limited to 'src/machine')
-rw-r--r-- | src/machine/image-dbus.c | 4 | ||||
-rw-r--r-- | src/machine/machine-dbus.c | 8 | ||||
-rw-r--r-- | src/machine/machined-dbus.c | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/machine/image-dbus.c b/src/machine/image-dbus.c index 698052dd86..f8c09a8b7c 100644 --- a/src/machine/image-dbus.c +++ b/src/machine/image-dbus.c @@ -31,7 +31,7 @@ int bus_image_method_remove( void *userdata, sd_bus_error *error) { - _cleanup_close_pair_ int errno_pipe_fd[2] = { -1, -1 }; + _cleanup_close_pair_ int errno_pipe_fd[2] = { -EBADF, -EBADF }; Image *image = ASSERT_PTR(userdata); Manager *m = image->userdata; pid_t child; @@ -145,7 +145,7 @@ int bus_image_method_clone( void *userdata, sd_bus_error *error) { - _cleanup_close_pair_ int errno_pipe_fd[2] = { -1, -1 }; + _cleanup_close_pair_ int errno_pipe_fd[2] = { -EBADF, -EBADF }; Image *image = ASSERT_PTR(userdata); Manager *m = ASSERT_PTR(image->userdata); const char *new_name; diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c index 26ba5d4292..1867893004 100644 --- a/src/machine/machine-dbus.c +++ b/src/machine/machine-dbus.c @@ -223,7 +223,7 @@ int bus_machine_method_get_addresses(sd_bus_message *message, void *userdata, sd } case MACHINE_CONTAINER: { - _cleanup_close_pair_ int pair[2] = { -1, -1 }; + _cleanup_close_pair_ int pair[2] = { -EBADF, -EBADF }; _cleanup_free_ char *us = NULL, *them = NULL; _cleanup_close_ int netns_fd = -EBADF; const char *p; @@ -371,7 +371,7 @@ int bus_machine_method_get_os_release(sd_bus_message *message, void *userdata, s case MACHINE_CONTAINER: { _cleanup_close_ int mntns_fd = -EBADF, root_fd = -EBADF, pidns_fd = -EBADF; - _cleanup_close_pair_ int pair[2] = { -1, -1 }; + _cleanup_close_pair_ int pair[2] = { -EBADF, -EBADF }; _cleanup_fclose_ FILE *f = NULL; pid_t child; @@ -888,7 +888,7 @@ int bus_machine_method_bind_mount(sd_bus_message *message, void *userdata, sd_bu int bus_machine_method_copy(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_free_ char *host_basename = NULL, *container_basename = NULL; const char *src, *dest, *host_path, *container_path; - _cleanup_close_pair_ int errno_pipe_fd[2] = { -1, -1 }; + _cleanup_close_pair_ int errno_pipe_fd[2] = { -EBADF, -EBADF }; CopyFlags copy_flags = COPY_REFLINK|COPY_MERGE|COPY_HARDLINKS; _cleanup_close_ int hostfd = -EBADF; Machine *m = ASSERT_PTR(userdata); @@ -1085,7 +1085,7 @@ int bus_machine_method_open_root_directory(sd_bus_message *message, void *userda case MACHINE_CONTAINER: { _cleanup_close_ int mntns_fd = -EBADF, root_fd = -EBADF; - _cleanup_close_pair_ int pair[2] = { -1, -1 }; + _cleanup_close_pair_ int pair[2] = { -EBADF, -EBADF }; pid_t child; r = namespace_open(m->leader, NULL, &mntns_fd, NULL, NULL, &root_fd); diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c index aef3e90542..ed28627826 100644 --- a/src/machine/machined-dbus.c +++ b/src/machine/machined-dbus.c @@ -683,7 +683,7 @@ static int method_clean_pool(sd_bus_message *message, void *userdata, sd_bus_err REMOVE_HIDDEN, } mode; - _cleanup_close_pair_ int errno_pipe_fd[2] = { -1, -1 }; + _cleanup_close_pair_ int errno_pipe_fd[2] = { -EBADF, -EBADF }; _cleanup_close_ int result_fd = -EBADF; Manager *m = userdata; Operation *operation; |