mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Introduce VIR_DIR_CLOSE
Introduce a helper that only calls closedir if DIR* is non-NULL and sets it to NULL afterwards.
This commit is contained in:
@@ -144,7 +144,7 @@ virNetDevTapGetRealDeviceName(char *ifname ATTRIBUTE_UNUSED)
|
||||
cleanup:
|
||||
VIR_FREE(devpath);
|
||||
VIR_FORCE_CLOSE(fd);
|
||||
closedir(dirp);
|
||||
VIR_DIR_CLOSE(dirp);
|
||||
return ret;
|
||||
#else
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user