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:
Ján Tomko
2016-06-21 12:40:29 +02:00
parent 44f5b3f869
commit a4e6f1eb9c
31 changed files with 66 additions and 77 deletions

View File

@@ -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;