diff options
author | Mateusz Grzonka <mateusz.grzonka@intel.com> | 2021-11-24 11:48:33 +0100 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2021-11-24 13:07:12 +0100 |
commit | b71de056cec70784ef2727e2febd7a6c88e580db (patch) | |
tree | a9c39829732f54c378dcd334b78097e8e4a17c6e /Assemble.c | |
parent | Incremental: Close unclosed mdfd in IncrementalScan() (diff) | |
download | mdadm-b71de056cec70784ef2727e2febd7a6c88e580db.tar.xz mdadm-b71de056cec70784ef2727e2febd7a6c88e580db.zip |
Correct checking if file descriptors are valid
In some cases file descriptors equal to 0 are treated as invalid.
Fix it.
Signed-off-by: Mateusz Grzonka <mateusz.grzonka@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'Assemble.c')
-rw-r--r-- | Assemble.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -569,8 +569,7 @@ static int select_devices(struct mddev_dev *devlist, if (dfd < 0 || st->ss->load_super(st, dfd, NULL)) tmpdev->used = 2; - if (dfd > 0) - close(dfd); + close_fd(&dfd); } } |