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 --- conf.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'conf.c') diff --git a/conf.c b/conf.c index 37f25d6..0e512f4 100644 --- a/conf.c +++ b/conf.c @@ -1064,9 +1064,6 @@ static void conf_ugid(char *runas, uid_t *uid, gid_t *gid) if ((fd = open("/proc/self/uid_map", O_RDONLY | O_CLOEXEC)) < 0) { die("Can't determine if we're in init namespace: %s", strerror(errno)); - - /* Silence cppcheck's invalidFunctionArg for 'fd' in read() */ - return; } if (read(fd, buf, BUFSIZ) != sizeof(root_uid_map) || -- cgit v1.2.3