qemuDomainCreateNamespace: s/unlink/rmdir/

If something goes wrong in this function we try a rollback. That
is unlink all the directories we created earlier. For some weird
reason unlink() was called instead of rmdir().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2017-01-06 11:02:42 +01:00
parent 095f042ed6
commit 40ebbf72d5

View File

@ -7467,9 +7467,9 @@ qemuDomainCreateNamespace(virQEMUDriverPtr driver,
cleanup:
if (ret < 0) {
if (devPath)
unlink(devPath);
rmdir(devPath);
for (i = 0; i < ndevMountsSavePath; i++)
unlink(devMountsSavePath[i]);
rmdir(devMountsSavePath[i]);
}
virStringListFreeCount(devMountsSavePath, ndevMountsSavePath);
VIR_FREE(devPath);