]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dissect-image: handle 'continue' event in metadata acquisition uniformly
authorLennart Poettering <lennart@poettering.net>
Mon, 4 Dec 2023 17:19:27 +0000 (18:19 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 12 Dec 2023 15:19:21 +0000 (16:19 +0100)
Let's jump to the same label in all cases, that closes the associated
pipe, systematically.

src/shared/dissect-image.c

index b63973cea8cfe9c4546ad7a9c955612a1414b106..7142429642f730a7f7d911ed758fb119129c52f5 100644 (file)
@@ -3494,7 +3494,7 @@ int dissected_image_acquire_metadata(DissectedImage *m, DissectImageFlags extra_
                                 if (r < 0)
                                         goto inner_fail;
 
-                                continue;
+                                goto next;
                         }
 
                         default:
@@ -3507,14 +3507,14 @@ int dissected_image_acquire_metadata(DissectedImage *m, DissectImageFlags extra_
 
                         if (fd < 0) {
                                 log_debug_errno(fd, "Failed to read %s file of image, ignoring: %m", paths[k]);
-                                fds[2*k+1] = safe_close(fds[2*k+1]);
-                                continue;
+                                goto next;
                         }
 
                         r = copy_bytes(fd, fds[2*k+1], UINT64_MAX, 0);
                         if (r < 0)
                                 goto inner_fail;
 
+                next:
                         fds[2*k+1] = safe_close(fds[2*k+1]);
                 }