]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cgroup: Add missing errno == ENOENT check in virCgroupRemoveRecursively
authorRyota Ozaki <ozaki.ryota@gmail.com>
Sat, 26 Jun 2010 17:21:28 +0000 (02:21 +0900)
committerEric Blake <eblake@redhat.com>
Tue, 29 Jun 2010 18:16:51 +0000 (12:16 -0600)
ENOENT happens normally when a subsystem is enabled with any other
subsystems and the directory of the target group has already removed
in a prior loop. In that case, the function should just return without
leaving an error message.

NB this is the same behavior as before introducing virCgroupRemoveRecursively.

src/util/cgroup.c

index 62b14465b0e4e039672c9063a05c66907d6ecc3d..9fa64dca2ff1aaa9f3e42a53e52fac249558bf61 100644 (file)
@@ -616,6 +616,8 @@ static int virCgroupRemoveRecursively(char *grppath)
 
     grpdir = opendir(grppath);
     if (grpdir == NULL) {
+        if (errno == ENOENT)
+            return 0;
         VIR_ERROR(_("Unable to open %s (%d)"), grppath, errno);
         rc = -errno;
         return rc;