From e50fe3b06018dd24ce7d9b552e4da336c18e4a9d Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 1 May 2022 22:12:02 +0200 Subject: [PATCH] plugins: use reentrant API getmntent_r() Signed-off-by: Joachim Wiberg --- plugins/bootmisc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/bootmisc.c b/plugins/bootmisc.c index 0817693f..729fe2ce 100644 --- a/plugins/bootmisc.c +++ b/plugins/bootmisc.c @@ -39,10 +39,12 @@ static int is_tmpfs(char *path) { + struct mntent mount; + struct mntent *mnt; + char buf[256]; int tmpfs = 0; FILE *fp; char *dir; - struct mntent *mnt; /* If path is a symlink, check what it resolves to */ dir = realpath(path, NULL); @@ -55,7 +57,7 @@ static int is_tmpfs(char *path) return 0; /* Dunno, maybe not */ } - while ((mnt = getmntent(fp))) { + while ((mnt = getmntent_r(fp, &mount, buf, sizeof(buf)))) { if (!strcmp(dir, mnt->mnt_dir)) break; }