1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-12 13:18:14 +03:00

dissect-image: path[] is now defined for all metadata fields

There's no point in handling a case that never can happen.
This commit is contained in:
Lennart Poettering 2023-12-04 18:18:48 +01:00
parent 026a8b022e
commit 3ee413e632

View File

@ -3390,10 +3390,7 @@ int dissected_image_acquire_metadata(DissectedImage *m, DissectImageFlags extra_
assert(m);
for (; n_meta_initialized < _META_MAX; n_meta_initialized ++) {
if (!paths[n_meta_initialized]) {
fds[2*n_meta_initialized] = fds[2*n_meta_initialized+1] = -EBADF;
continue;
}
assert(paths[n_meta_initialized]);
if (pipe2(fds + 2*n_meta_initialized, O_CLOEXEC) < 0) {
r = -errno;
@ -3435,8 +3432,7 @@ int dissected_image_acquire_metadata(DissectedImage *m, DissectImageFlags extra_
for (unsigned k = 0; k < _META_MAX; k++) {
_cleanup_close_ int fd = -ENOENT;
if (!paths[k])
continue;
assert(paths[k]);
fds[2*k] = safe_close(fds[2*k]);
@ -3535,8 +3531,7 @@ int dissected_image_acquire_metadata(DissectedImage *m, DissectImageFlags extra_
for (unsigned k = 0; k < _META_MAX; k++) {
_cleanup_fclose_ FILE *f = NULL;
if (!paths[k])
continue;
assert(paths[k]);
fds[2*k+1] = safe_close(fds[2*k+1]);