Skip to content

Commit

Permalink
fix#676 use hwloc_access instead of hwloc_accessat
Browse files Browse the repository at this point in the history
(cherry picked from commit 9a503a2)
  • Loading branch information
zhchgbj authored and bgoglin committed Jul 22, 2024
1 parent af6f7fe commit 8ba621a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hwloc/topology-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -2287,17 +2287,17 @@ hwloc_find_linux_cgroup_mntpnt(enum hwloc_linux_cgroup_type_e *cgtype, char **mn
size_t bufsize;

/* try standard mount points */
if (!hwloc_accessat("/sys/fs/cgroup/cpuset.cpus.effective", R_OK, fsroot_fd)) {
if (!hwloc_access("/sys/fs/cgroup/cpuset.cpus.effective", R_OK, fsroot_fd)) {
hwloc_debug("Found standard cgroup2/cpuset mount point at /sys/fs/cgroup/\n");
*cgtype = HWLOC_LINUX_CGROUP2;
*mntpnt = strdup("/sys/fs/cgroup");
return;
} else if (!hwloc_accessat("/sys/fs/cgroup/cpuset/cpuset.cpus", R_OK, fsroot_fd)) {
} else if (!hwloc_access("/sys/fs/cgroup/cpuset/cpuset.cpus", R_OK, fsroot_fd)) {
hwloc_debug("Found standard cgroup1/cpuset mount point at /sys/fs/cgroup/cpuset/\n");
*cgtype = HWLOC_LINUX_CGROUP1;
*mntpnt = strdup("/sys/fs/cgroup/cpuset");
return;
} else if (!hwloc_accessat("/dev/cpuset/cpus", R_OK, fsroot_fd)) {
} else if (!hwloc_access("/dev/cpuset/cpus", R_OK, fsroot_fd)) {
hwloc_debug("Found standard cpuset mount point at /dev/cpuset/\n");
*cgtype = HWLOC_LINUX_CPUSET;
*mntpnt = strdup("/dev/cpuset");
Expand Down

0 comments on commit 8ba621a

Please sign in to comment.