aboutgitcodebugslistschat
path: root/tap.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2023-02-27 04:06:19 +0100
committerStefano Brivio <sbrivio@redhat.com>2023-02-27 18:55:57 +0100
commitd2df7632321c473cd57064e2350b219fbc3f6677 (patch)
treeec81d4c0e51397e48f95f43d6180fb1bac69e3b6 /tap.c
parentfb05a713789fd9c20d0432f023ce26f3c5b94251 (diff)
downloadpasst-d2df7632321c473cd57064e2350b219fbc3f6677.tar
passt-d2df7632321c473cd57064e2350b219fbc3f6677.tar.gz
passt-d2df7632321c473cd57064e2350b219fbc3f6677.tar.bz2
passt-d2df7632321c473cd57064e2350b219fbc3f6677.tar.lz
passt-d2df7632321c473cd57064e2350b219fbc3f6677.tar.xz
passt-d2df7632321c473cd57064e2350b219fbc3f6677.tar.zst
passt-d2df7632321c473cd57064e2350b219fbc3f6677.zip
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 <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tap.c')
-rw-r--r--tap.c6
1 files changed, 1 insertions, 5 deletions
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)) {