diff mbox series

[18/19] Unify error handling in lib/tst_resource.c

Message ID 20201026164756.30556-19-mdoucha@suse.cz
State Accepted
Headers show
Series Unify error handling in LTP library | expand

Commit Message

Martin Doucha Oct. 26, 2020, 4:47 p.m. UTC
- Properly format caller file:line location

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 lib/tst_resource.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Cyril Hrubis Nov. 6, 2020, 1:05 p.m. UTC | #1
Hi!
Applied, thanks.
diff mbox series

Patch

diff --git a/lib/tst_resource.c b/lib/tst_resource.c
index 0b9b381f1..c35d05a25 100644
--- a/lib/tst_resource.c
+++ b/lib/tst_resource.c
@@ -102,9 +102,8 @@  void tst_resource_copy(const char *file, const int lineno,
 		       const char *filename, const char *dest)
 {
 	if (!tst_tmpdir_created()) {
-		tst_brkm(TBROK, cleanup_fn,
-		         "Temporary directory doesn't exist at %s:%d",
-		         file, lineno);
+		tst_brkm_(file, lineno, TBROK, cleanup_fn,
+			"Temporary directory doesn't exist");
 		return;
 	}
 
@@ -133,6 +132,6 @@  void tst_resource_copy(const char *file, const int lineno,
 	if (file_copy(file, lineno, cleanup_fn, startwd, filename, dest))
 		return;
 
-	tst_brkm(TBROK, cleanup_fn, "Failed to copy resource '%s' at %s:%d",
-	         filename, file, lineno);
+	tst_brkm_(file, lineno, TBROK, cleanup_fn,
+		"Failed to copy resource '%s'", filename);
 }