diff mbox series

madvise11: Replace /etc/mtab with /proc/mounts

Message ID 20231102230054.3195864-2-edliaw@google.com
State Accepted
Headers show
Series madvise11: Replace /etc/mtab with /proc/mounts | expand

Commit Message

Edward Liaw Nov. 2, 2023, 11 p.m. UTC
Android does not have the /etc/mtab symlink, so trying to open it fails
with TBROK.  Replace it with /proc/mounts.

Signed-off-by: Edward Liaw <edliaw@google.com>
---
 testcases/kernel/syscalls/madvise/madvise11.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Petr Vorel Nov. 3, 2023, 8:29 a.m. UTC | #1
Hi Edward,

> Android does not have the /etc/mtab symlink, so trying to open it fails
> with TBROK.  Replace it with /proc/mounts.

Thanks!

Reviewed-by: Petr Vorel <pvorel@suse.cz>

BTW there are other tests which mention /etc/mtab, but only as tst_resm(TINFO, )
message.

Kind regards,
Petr
Petr Vorel Nov. 3, 2023, 8:38 a.m. UTC | #2
Hi Edward,

merged, thanks!

Kind regards,
Petr
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/madvise/madvise11.c b/testcases/kernel/syscalls/madvise/madvise11.c
index 0793319d2..55556f530 100644
--- a/testcases/kernel/syscalls/madvise/madvise11.c
+++ b/testcases/kernel/syscalls/madvise/madvise11.c
@@ -308,9 +308,9 @@  static int open_unpoison_pfn(void)
 		SAFE_CMD(cmd_modprobe, NULL, NULL);
 
 	/* debugfs mount point */
-	mntf = setmntent("/etc/mtab", "r");
+	mntf = setmntent("/proc/mounts", "r");
 	if (!mntf) {
-		tst_brk(TBROK | TERRNO, "Can't open /etc/mtab");
+		tst_brk(TBROK | TERRNO, "Can't open /proc/mounts");
 		return -1;
 	}
 	while ((mnt = getmntent(mntf)) != NULL) {