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]);
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]);