pam_cgfs_debug("Invalid path: %s.\n", path);
return bret;
}
+
oldv = *lastslash;
*lastslash = '\0';
+
fpath = must_make_path(path, "cpuset.cpus", NULL);
posscpus = read_file(fpath);
if (!posscpus) {
/* This system doesn't expose isolated cpus. */
pam_cgfs_debug("%s", "Path: "__ISOL_CPUS" to read isolated cpus from does not exist.\n");
cpulist = posscpus;
+
/* No isolated cpus but we weren't already initialized by
* someone. We should simply copy the parents cpuset.cpus
* values.
pam_cgfs_debug("%s", "Copying cpuset of parent cgroup.\n");
goto copy_parent;
}
+
/* No isolated cpus but we were already initialized by someone.
* Nothing more to do for us.
*/
pam_cgfs_debug("%s", "Could not read file "__ISOL_CPUS"\n");
goto on_error;
}
+
if (!isdigit(isolcpus[0])) {
pam_cgfs_debug("%s", "No isolated cpus detected.\n");
cpulist = posscpus;
+
/* No isolated cpus but we weren't already initialized by
* someone. We should simply copy the parents cpuset.cpus
* values.
pam_cgfs_debug("%s", "Copying cpuset of parent cgroup.\n");
goto copy_parent;
}
+
/* No isolated cpus but we were already initialized by someone.
* Nothing more to do for us.
*/
copy_parent:
*lastslash = oldv;
+
+ if (fpath)
+ free(fpath);
+
fpath = must_make_path(path, "cpuset.cpus", NULL);
ret = write_to_file(fpath, cpulist, strlen(cpulist), false);
if (ret < 0) {