Skip to content

Commit 375e380

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

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/tst_net.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,11 @@ void safe_getaddrinfo(const char *file, const int lineno, const char *src_addr,
212212
{
213213
int err = getaddrinfo(src_addr, port, hints, addr_info);
214214

215-
if (err)
216-
tst_brk(TBROK, "%s:%d: getaddrinfo failed, %s", file, lineno,
217-
gai_strerror(err));
215+
if (err) {
216+
tst_brk_(file, lineno, TBROK, "getaddrinfo failed, %s",
217+
gai_strerror(err));
218+
}
218219

219220
if (!*addr_info)
220-
tst_brk(TBROK, "%s:%d: failed to get the address", file, lineno);
221+
tst_brk_(file, lineno, TBROK, "failed to get the address");
221222
}

0 commit comments

Comments
 (0)