while (!done) {
done = true;
if (!(fp = fopen(keypath, "r"))) {
+ if (errno == ENOENT) {
+ VIR_DEBUG("No file %s, assuming done", keypath);
+ killedAny = false;
+ goto done;
+ }
+
virReportSystemError(errno,
_("Failed to read %s"),
keypath);
}
}
+ done:
ret = killedAny ? 1 : 0;
cleanup:
if (rc == 1)
killedAny = true;
- VIR_DEBUG("Iterate over children of %s", keypath);
+ VIR_DEBUG("Iterate over children of %s (killedAny=%d)", keypath, killedAny);
if (!(dp = opendir(keypath))) {
+ if (errno == ENOENT) {
+ VIR_DEBUG("Path %s does not exist, assuming done", keypath);
+ killedAny = false;
+ goto done;
+ }
virReportSystemError(errno,
_("Cannot open %s"), keypath);
return -1;
virCgroupFree(&subgroup);
}
+ done:
ret = killedAny ? 1 : 0;
cleanup: