X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=cgroup.c;h=de00d986eb05246b25e853c3af524149f1b53e22;hp=f36683aeacf311561c6ba768565361c547fcd9bf;hb=599e72b74ed2c44fd846b95160c5037c16438994;hpb=8a3220572e1016ea011bd9dcf61a5bfb731c1a43 diff --git a/cgroup.c b/cgroup.c index f36683ae..de00d986 100644 --- a/cgroup.c +++ b/cgroup.c @@ -22,7 +22,8 @@ struct cgroup_member { static char *find_cgroup_mnt(struct thread_data *td) { char *mntpoint = NULL; - struct mntent *mnt; + struct mntent *mnt, dummy; + char buf[256] = {0}; FILE *f; f = setmntent("/proc/mounts", "r"); @@ -31,7 +32,7 @@ static char *find_cgroup_mnt(struct thread_data *td) return NULL; } - while ((mnt = getmntent(f)) != NULL) { + while ((mnt = getmntent_r(f, &dummy, buf, sizeof(buf))) != NULL) { if (!strcmp(mnt->mnt_type, "cgroup") && strstr(mnt->mnt_opts, "blkio")) break;