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:
parent
026a8b022e
commit
3ee413e632
@ -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]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user