]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/udev/udevadm-test-builtin.c
Merge pull request #13936 from keszybz/format-table-uninhibited
[thirdparty/systemd.git] / src / udev / udevadm-test-builtin.c
index 6be3871d0b5fc3e9d6d9d7789feb32712ec90c4e..eb5d3e2b905f66c5d0d644771198e72827b20870 100644 (file)
@@ -49,23 +49,21 @@ static int parse_argv(int argc, char *argv[]) {
                 }
 
         arg_command = argv[optind++];
-        if (!arg_command) {
-                log_error("Command missing.");
-                return -EINVAL;
-        }
+        if (!arg_command)
+                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+                                       "Command missing.");
 
         arg_syspath = argv[optind++];
-        if (!arg_syspath) {
-                log_error("syspath missing.");
-                return -EINVAL;
-        }
+        if (!arg_syspath)
+                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+                                       "syspath missing.");
 
         return 1;
 }
 
 int builtin_main(int argc, char *argv[], void *userdata) {
         _cleanup_(sd_device_unrefp) sd_device *dev = NULL;
-        enum udev_builtin_cmd cmd;
+        UdevBuiltinCommand cmd;
         int r;
 
         log_set_max_level(LOG_DEBUG);
@@ -91,7 +89,7 @@ int builtin_main(int argc, char *argv[], void *userdata) {
 
         r = udev_builtin_run(dev, cmd, arg_command, true);
         if (r < 0)
-                log_debug("error executing '%s', exit code %i", arg_command, r);
+                log_debug_errno(r, "Builtin command '%s' fails: %m", arg_command);
 
 finish:
         udev_builtin_exit();