Do not check for '.' and '..' after virDirRead

It skips those directory entries.
This commit is contained in:
Ján Tomko 2016-06-21 17:25:58 +02:00
parent 7cecfba139
commit fe79c3f2c1
5 changed files with 0 additions and 23 deletions

View File

@ -980,9 +980,6 @@ virSecretLoadAllConfigs(virSecretObjListPtr secrets,
char *path;
virSecretObjPtr secret;
if (STREQ(de->d_name, ".") || STREQ(de->d_name, ".."))
continue;
if (!virFileHasSuffix(de->d_name, ".xml"))
continue;

View File

@ -530,10 +530,6 @@ networkMigrateStateFiles(virNetworkDriverStatePtr driver)
entry->d_type != DT_REG)
continue;
if (STREQ(entry->d_name, ".") ||
STREQ(entry->d_name, ".."))
continue;
if (virAsprintf(&oldPath, "%s/%s",
oldStateDir, entry->d_name) < 0)
goto cleanup;

View File

@ -3637,10 +3637,6 @@ virCgroupKillRecursiveInternal(virCgroupPtr group,
}
while ((direrr = virDirRead(dp, &ent, keypath)) > 0) {
if (STREQ(ent->d_name, "."))
continue;
if (STREQ(ent->d_name, ".."))
continue;
if (ent->d_type != DT_DIR)
continue;
@ -3964,10 +3960,6 @@ int virCgroupSetOwner(virCgroupPtr cgroup,
}
while ((direrr = virDirRead(dh, &de, base)) > 0) {
if (STREQ(de->d_name, ".") ||
STREQ(de->d_name, ".."))
continue;
if (virAsprintf(&entry, "%s/%s", base, de->d_name) < 0)
goto cleanup;

View File

@ -951,10 +951,6 @@ int virFileDeleteTree(const char *dir)
while ((direrr = virDirRead(dh, &de, dir)) > 0) {
struct stat sb;
if (STREQ(de->d_name, ".") ||
STREQ(de->d_name, ".."))
continue;
if (virAsprintf(&filepath, "%s/%s",
dir, de->d_name) < 0)
goto cleanup;

View File

@ -2701,10 +2701,6 @@ virPCIGetNetName(char *device_link_sysfs_path, char **netname)
goto out;
while (virDirRead(dir, &entry, pcidev_sysfs_net_path) > 0) {
if (STREQ(entry->d_name, ".") ||
STREQ(entry->d_name, ".."))
continue;
/* Assume a single directory entry */
if (VIR_STRDUP(*netname, entry->d_name) > 0)
ret = 0;