From: Zbigniew Jędrzejewski-Szmek Date: Tue, 9 Oct 2018 07:23:52 +0000 (+0200) Subject: test-udev: remove unsatisfiable conditionals X-Git-Tag: v240~604^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ac1a3726be5d13cd3b1aad1c4fdf4e6480e03acf;p=thirdparty%2Fsystemd.git test-udev: remove unsatisfiable conditionals CID #1396013. --- diff --git a/src/test/test-udev.c b/src/test/test-udev.c index 03cd99f000a..5d0a63cb33c 100644 --- a/src/test/test-udev.c +++ b/src/test/test-udev.c @@ -56,28 +56,22 @@ int main(int argc, char *argv[]) { _cleanup_(udev_device_unrefp) struct udev_device *dev = NULL; _cleanup_(udev_rules_unrefp) struct udev_rules *rules = NULL; const char *devpath, *action; - int r; test_setup_logging(LOG_INFO); - r = fake_filesystems(); - if (r < 0) + if (argc != 3) { + log_error("This program needs two arguments, %d given", argc - 1); + return EXIT_FAILURE; + } + + if (fake_filesystems() < 0) return EXIT_FAILURE; log_debug("version %s", PACKAGE_VERSION); mac_selinux_init(); action = argv[1]; - if (!action) { - log_error("action missing"); - goto out; - } - devpath = argv[2]; - if (!devpath) { - log_error("devpath missing"); - goto out; - } rules = udev_rules_new(1); @@ -120,5 +114,5 @@ int main(int argc, char *argv[]) { out: mac_selinux_finish(); - return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; + return EXIT_SUCCESS; }