diff mbox series

[10/19] Unify error handling in lib/tst_net.c

Message ID 20201026164756.30556-11-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_net.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

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

Patch

diff --git a/lib/tst_net.c b/lib/tst_net.c
index 8a589b0ad..de343bb39 100644
--- a/lib/tst_net.c
+++ b/lib/tst_net.c
@@ -212,10 +212,11 @@  void safe_getaddrinfo(const char *file, const int lineno, const char *src_addr,
 {
 	int err = getaddrinfo(src_addr, port, hints, addr_info);
 
-	if (err)
-		tst_brk(TBROK, "%s:%d: getaddrinfo failed, %s", file, lineno,
-				gai_strerror(err));
+	if (err) {
+		tst_brk_(file, lineno, TBROK, "getaddrinfo failed, %s",
+			gai_strerror(err));
+	}
 
 	if (!*addr_info)
-		tst_brk(TBROK, "%s:%d: failed to get the address", file, lineno);
+		tst_brk_(file, lineno, TBROK, "failed to get the address");
 }