From: Laine Stump Date: Mon, 14 Dec 2009 15:15:28 +0000 (+0100) Subject: Eliminate failure to delete empty storage pools X-Git-Tag: v0.7.5~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22f3ec27a3e05a8fe4610a3f08c35c50cb60ca11;p=thirdparty%2Flibvirt.git Eliminate failure to delete empty storage pools * src/storage/storage_backend_fs.c: virStorageBackendFileSystemDelete was incorrectly calling unlink() in an attempt to remove a directory. It should be calling rmdir() instead. --- diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index 16e4bd937d..b7d4bd6d93 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -693,9 +693,9 @@ virStorageBackendFileSystemDelete(virConnectPtr conn, { /* XXX delete all vols first ? */ - if (unlink(pool->def->target.path) < 0) { + if (rmdir(pool->def->target.path) < 0) { virReportSystemError(conn, errno, - _("cannot unlink path '%s'"), + _("failed to remove pool '%s'"), pool->def->target.path); return -1; }