summaryrefslogtreecommitdiffstats
path: root/src/machine
diff options
context:
space:
mode:
authorIvan Kruglov <mail@ikruglov.com>2024-10-31 11:01:16 +0100
committerIvan Kruglov <mail@ikruglov.com>2024-11-01 15:21:22 +0100
commit95d5b9097ba6ecba27cc754c84203b4c5ec6cc74 (patch)
tree2301ab5c14685a1451e601b504eac011905a8502 /src/machine
parentmachine: introduce report_errno_and_exit() (diff)
downloadsystemd-95d5b9097ba6ecba27cc754c84203b4c5ec6cc74.tar.xz
systemd-95d5b9097ba6ecba27cc754c84203b4c5ec6cc74.zip
machine: use report_errno_and_exit() in dbus code
Diffstat (limited to 'src/machine')
-rw-r--r--src/machine/image-dbus.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/machine/image-dbus.c b/src/machine/image-dbus.c
index 2ae61f99b7..8eca1e4c95 100644
--- a/src/machine/image-dbus.c
+++ b/src/machine/image-dbus.c
@@ -67,14 +67,8 @@ int bus_image_method_remove(
return sd_bus_error_set_errnof(error, r, "Failed to fork(): %m");
if (r == 0) {
errno_pipe_fd[0] = safe_close(errno_pipe_fd[0]);
-
r = image_remove(image);
- if (r < 0) {
- (void) write(errno_pipe_fd[1], &r, sizeof(r));
- _exit(EXIT_FAILURE);
- }
-
- _exit(EXIT_SUCCESS);
+ report_errno_and_exit(errno_pipe_fd[1], r);
}
errno_pipe_fd[1] = safe_close(errno_pipe_fd[1]);
@@ -184,14 +178,8 @@ int bus_image_method_clone(
return sd_bus_error_set_errnof(error, r, "Failed to fork(): %m");
if (r == 0) {
errno_pipe_fd[0] = safe_close(errno_pipe_fd[0]);
-
r = image_clone(image, new_name, read_only);
- if (r < 0) {
- (void) write(errno_pipe_fd[1], &r, sizeof(r));
- _exit(EXIT_FAILURE);
- }
-
- _exit(EXIT_SUCCESS);
+ report_errno_and_exit(errno_pipe_fd[1], r);
}
errno_pipe_fd[1] = safe_close(errno_pipe_fd[1]);