test-execve: minor simplification

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2025-03-27 12:04:40 +01:00
parent fdfa9fd8ab
commit d193cb77c7
+2 -4
View File
@@ -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]);