mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
Do not check the return value of closedir
The only possible error is EBADFD. Since we only use the directory stream returned by opendir, this should never happen.
This commit is contained in:
parent
b914530d62
commit
44f5b3f869
@ -477,11 +477,8 @@ virHostCPUParseNode(const char *node,
|
||||
ret = processors;
|
||||
|
||||
cleanup:
|
||||
/* don't shadow a more serious error */
|
||||
if (cpudir && closedir(cpudir) < 0 && ret >= 0) {
|
||||
virReportSystemError(errno, _("problem closing %s"), node);
|
||||
ret = -1;
|
||||
}
|
||||
if (cpudir)
|
||||
closedir(cpudir);
|
||||
if (cores_maps)
|
||||
for (i = 0; i < sock_max; i++)
|
||||
virBitmapFree(cores_maps[i]);
|
||||
@ -777,12 +774,8 @@ virHostCPUGetInfoPopulateLinux(FILE *cpuinfo,
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
/* don't shadow a more serious error */
|
||||
if (nodedir && closedir(nodedir) < 0 && ret >= 0) {
|
||||
virReportSystemError(errno, _("problem closing %s"), sysfs_nodedir);
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
if (nodedir)
|
||||
closedir(nodedir);
|
||||
virBitmapFree(present_cpus_map);
|
||||
virBitmapFree(online_cpus_map);
|
||||
VIR_FREE(sysfs_nodedir);
|
||||
|
Loading…
Reference in New Issue
Block a user