From: Ryota Ozaki Date: Sat, 26 Jun 2010 17:21:28 +0000 (+0900) Subject: cgroup: Add missing errno == ENOENT check in virCgroupRemoveRecursively X-Git-Tag: v0.8.2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=adc796c8eb6d573a6311e5f95e087f6c0758ad3f;p=thirdparty%2Flibvirt.git cgroup: Add missing errno == ENOENT check in virCgroupRemoveRecursively 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. --- diff --git a/src/util/cgroup.c b/src/util/cgroup.c index 62b14465b0..9fa64dca2f 100644 --- a/src/util/cgroup.c +++ b/src/util/cgroup.c @@ -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;