[LTP] [COMMITTED] safe_mount: tolerate the realpath fails

Li Wang liwang@redhat.com
Fri Jun 16 11:40:59 CEST 2023


realpath() failure is not a fatal error in safe_mount,
it's safe to tolerate them.

Follow-up-fix: 3490c2842b93bbde71168d8598d06f15ea5d4010
Signed-off-by: Li Wang <liwang@redhat.com>
---
 lib/safe_macros.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/safe_macros.c b/lib/safe_macros.c
index 037eb0e62..951e1b064 100644
--- a/lib/safe_macros.c
+++ b/lib/safe_macros.c
@@ -905,7 +905,7 @@ int safe_mount(const char *file, const int lineno, void (*cleanup_fn)(void),
 			"Mounting %s to %s fstyp=%s flags=%lx",
 			source, mpath, filesystemtype, mountflags);
 	} else {
-		tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn,
+		tst_resm_(file, lineno, TINFO | TERRNO,
 			"Cannot resolve the absolute path of %s", target);
 	}
 	/*
@@ -962,7 +962,7 @@ int safe_umount(const char *file, const int lineno, void (*cleanup_fn)(void),
 	if (realpath(target, mpath)) {
 		tst_resm_(file, lineno, TINFO, "Umounting %s", mpath);
 	} else {
-		tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn,
+		tst_resm_(file, lineno, TINFO | TERRNO,
 			"Cannot resolve the absolute path of %s", target);
 	}
 
-- 
2.40.1



More information about the ltp mailing list