From d193cb77c76be43e3a130a19e329093168dc4a50 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 19 Nov 2024 16:51:39 +0100 Subject: [PATCH] test-execve: minor simplification --- src/test/test-execve.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/test-execve.c b/src/test/test-execve.c index e7a9a513774..6865ba92744 100644 --- a/src/test/test-execve.c +++ b/src/test/test-execve.c @@ -20,15 +20,13 @@ */ static int run(int argc, char **argv) { - _cleanup_close_ int fd = -EBADF; - char **args = strv_skip(argv, 1); int r; test_setup_logging(LOG_DEBUG); - args = !strv_isempty(args) ? args : STRV_MAKE("/bin/true"); + char **args = strv_skip(argv, 1) ?: STRV_MAKE("/bin/true"); - fd = open(args[0], O_RDONLY | O_CLOEXEC); + _cleanup_close_ int fd = open(args[0], O_RDONLY | O_CLOEXEC); if (fd < 0) return log_error_errno(errno, "open(%s) failed: %m", args[0]); -- 2.47.3