]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-execve: minor simplification
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 19 Nov 2024 15:51:39 +0000 (16:51 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 27 Mar 2025 11:04:40 +0000 (12:04 +0100)
src/test/test-execve.c

index e7a9a5137741310be6692d75f5a801905a03ee8c..6865ba92744fe541bce4f8a4bc06985879716536 100644 (file)
  */
 
 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]);