diff options
author | Ivan Kruglov <mail@ikruglov.com> | 2024-11-06 11:13:39 +0100 |
---|---|---|
committer | Ivan Kruglov <mail@ikruglov.com> | 2024-11-06 11:18:38 +0100 |
commit | 3d44b469f38b8b58830dcc595420e4f943697301 (patch) | |
tree | cdef271d75a3f098239c0e72f27c094979b1a81e /src/shared/dissect-image.c | |
parent | use report_errno_and_exit() in src/shared/mount-util.c (diff) | |
download | systemd-3d44b469f38b8b58830dcc595420e4f943697301.tar.xz systemd-3d44b469f38b8b58830dcc595420e4f943697301.zip |
use report_errno_and_exit() in src/shared/dissect-image.c
Diffstat (limited to '')
-rw-r--r-- | src/shared/dissect-image.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index f12a93d0dc..f9418754a8 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -3522,7 +3522,7 @@ int dissected_image_acquire_metadata( r = detach_mount_namespace_userns(userns_fd); if (r < 0) { log_debug_errno(r, "Failed to detach mount namespace: %m"); - goto inner_fail; + report_errno_and_exit(error_pipe[1], r); } r = dissected_image_mount( @@ -3537,7 +3537,7 @@ int dissected_image_acquire_metadata( DISSECT_IMAGE_USR_NO_ROOT); if (r < 0) { log_debug_errno(r, "Failed to mount dissected image: %m"); - goto inner_fail; + report_errno_and_exit(error_pipe[1], r); } for (unsigned k = 0; k < _META_MAX; k++) { @@ -3609,7 +3609,7 @@ int dissected_image_acquire_metadata( r = loop_write(fds[2*k+1], &found, sizeof(found)); if (r < 0) - goto inner_fail; + report_errno_and_exit(error_pipe[1], r); goto next; } @@ -3629,18 +3629,13 @@ int dissected_image_acquire_metadata( r = copy_bytes(fd, fds[2*k+1], UINT64_MAX, 0); if (r < 0) - goto inner_fail; + report_errno_and_exit(error_pipe[1], r); next: fds[2*k+1] = safe_close(fds[2*k+1]); } _exit(EXIT_SUCCESS); - - inner_fail: - /* Let parent know the error */ - (void) write(error_pipe[1], &r, sizeof(r)); - _exit(EXIT_FAILURE); } error_pipe[1] = safe_close(error_pipe[1]); |