Skip to content

Commit 2932354

Browse files
mdouchametan-ucw
authored andcommitted
Unify error handling in lib/tst_resource.c
- Properly format caller file:line location Signed-off-by: Martin Doucha <[email protected]> Reviewed-by: Cyril Hrubis <[email protected]>
1 parent 9c12319 commit 2932354

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/tst_resource.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,8 @@ void tst_resource_copy(const char *file, const int lineno,
102102
const char *filename, const char *dest)
103103
{
104104
if (!tst_tmpdir_created()) {
105-
tst_brkm(TBROK, cleanup_fn,
106-
"Temporary directory doesn't exist at %s:%d",
107-
file, lineno);
105+
tst_brkm_(file, lineno, TBROK, cleanup_fn,
106+
"Temporary directory doesn't exist");
108107
return;
109108
}
110109

@@ -133,6 +132,6 @@ void tst_resource_copy(const char *file, const int lineno,
133132
if (file_copy(file, lineno, cleanup_fn, startwd, filename, dest))
134133
return;
135134

136-
tst_brkm(TBROK, cleanup_fn, "Failed to copy resource '%s' at %s:%d",
137-
filename, file, lineno);
135+
tst_brkm_(file, lineno, TBROK, cleanup_fn,
136+
"Failed to copy resource '%s'", filename);
138137
}

0 commit comments

Comments
 (0)