From d2df7632321c473cd57064e2350b219fbc3f6677 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Mon, 27 Feb 2023 04:06:19 +0100 Subject: log, conf, tap: Define die() as err() plus exit(), drop cppcheck workarounds If we define die() as a variadic macro, passing __VA_ARGS__ to err(), and calling exit() outside err() itself, we can drop the workarounds introduced in commit 36f0199f6ef4 ("conf, tap: Silence two false positive invalidFunctionArg from cppcheck"). Suggested-by: David Gibson Signed-off-by: Stefano Brivio Reviewed-by: David Gibson --- tap.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'tap.c') diff --git a/tap.c b/tap.c index d6f962e..88eed88 100644 --- a/tap.c +++ b/tap.c @@ -1037,13 +1037,9 @@ static void tap_sock_unix_init(struct ctx *c) snprintf(path, UNIX_PATH_MAX - 1, UNIX_SOCK_PATH, i); ex = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0); - if (ex < 0) { + if (ex < 0) die("UNIX domain socket check: %s", strerror(errno)); - /* Silence cppcheck's invalidFunctionArg for 'ex' */ - return; - } - ret = connect(ex, (const struct sockaddr *)&addr, sizeof(addr)); if (!ret || (errno != ENOENT && errno != ECONNREFUSED && errno != EACCES)) { -- cgit v1.2.3