mirror of
https://github.com/systemd/systemd.git
synced 2025-02-10 17:57:40 +03:00
udev-builtin: propagate negative errno
This commit is contained in:
parent
45a73f4be3
commit
d354690e7d
@ -182,6 +182,8 @@ static int probe_superblocks(blkid_probe pr) {
|
||||
struct stat st;
|
||||
int rc;
|
||||
|
||||
/* TODO: Return negative errno. */
|
||||
|
||||
if (fstat(blkid_probe_get_fd(pr), &st))
|
||||
return -errno;
|
||||
|
||||
@ -235,11 +237,9 @@ static int builtin_blkid(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
case 'o':
|
||||
r = safe_atoi64(optarg, &offset);
|
||||
if (r < 0)
|
||||
goto out;
|
||||
if (offset < 0) {
|
||||
r = -ERANGE;
|
||||
goto out;
|
||||
}
|
||||
return r;
|
||||
if (offset < 0)
|
||||
return -ERANGE;
|
||||
break;
|
||||
case 'R':
|
||||
noraid = true;
|
||||
@ -247,9 +247,10 @@ static int builtin_blkid(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
}
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
pr = blkid_new_probe();
|
||||
if (!pr)
|
||||
return EXIT_FAILURE;
|
||||
return errno > 0 ? -errno : -ENOMEM;
|
||||
|
||||
blkid_probe_set_superblocks_flags(pr,
|
||||
BLKID_SUBLKS_LABEL | BLKID_SUBLKS_UUID |
|
||||
@ -261,17 +262,16 @@ static int builtin_blkid(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
|
||||
r = sd_device_get_devname(dev, &devnode);
|
||||
if (r < 0)
|
||||
goto out;
|
||||
return r;
|
||||
|
||||
fd = open(devnode, O_RDONLY|O_CLOEXEC);
|
||||
if (fd < 0) {
|
||||
r = log_debug_errno(errno, "Failure opening block device %s: %m", devnode);
|
||||
goto out;
|
||||
}
|
||||
if (fd < 0)
|
||||
return log_debug_errno(errno, "Failure opening block device %s: %m", devnode);
|
||||
|
||||
errno = 0;
|
||||
r = blkid_probe_set_device(pr, fd, offset, 0);
|
||||
if (r < 0)
|
||||
goto out;
|
||||
return errno > 0 ? -errno : -ENOMEM;
|
||||
|
||||
log_debug("probe %s %sraid offset=%"PRIi64,
|
||||
devnode,
|
||||
@ -279,7 +279,7 @@ static int builtin_blkid(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
|
||||
r = probe_superblocks(pr);
|
||||
if (r < 0)
|
||||
goto out;
|
||||
return r;
|
||||
|
||||
/* If we are a partition then our parent passed on the root
|
||||
* partition UUID to us */
|
||||
@ -305,8 +305,7 @@ static int builtin_blkid(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
if (is_gpt)
|
||||
find_gpt_root(dev, pr, test);
|
||||
|
||||
out:
|
||||
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const struct udev_builtin udev_builtin_blkid = {
|
||||
|
@ -18,22 +18,22 @@
|
||||
static int builtin_btrfs(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
struct btrfs_ioctl_vol_args args = {};
|
||||
_cleanup_close_ int fd = -1;
|
||||
int err;
|
||||
int r;
|
||||
|
||||
if (argc != 3 || !streq(argv[1], "ready"))
|
||||
return EXIT_FAILURE;
|
||||
return -EINVAL;
|
||||
|
||||
fd = open("/dev/btrfs-control", O_RDWR|O_CLOEXEC);
|
||||
if (fd < 0)
|
||||
return EXIT_FAILURE;
|
||||
return -errno;
|
||||
|
||||
strscpy(args.name, sizeof(args.name), argv[2]);
|
||||
err = ioctl(fd, BTRFS_IOC_DEVICES_READY, &args);
|
||||
if (err < 0)
|
||||
return EXIT_FAILURE;
|
||||
r = ioctl(fd, BTRFS_IOC_DEVICES_READY, &args);
|
||||
if (r < 0)
|
||||
return -errno;
|
||||
|
||||
udev_builtin_add_property(dev, test, "ID_BTRFS_READY", one_zero(err == 0));
|
||||
return EXIT_SUCCESS;
|
||||
udev_builtin_add_property(dev, test, "ID_BTRFS_READY", one_zero(r == 0));
|
||||
return 0;
|
||||
}
|
||||
|
||||
const struct udev_builtin udev_builtin_btrfs = {
|
||||
|
@ -127,9 +127,10 @@ static int builtin_hwdb(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
const char *subsystem = NULL;
|
||||
const char *prefix = NULL;
|
||||
_cleanup_(sd_device_unrefp) sd_device *srcdev = NULL;
|
||||
int r;
|
||||
|
||||
if (!hwdb)
|
||||
return EXIT_FAILURE;
|
||||
return -EINVAL;
|
||||
|
||||
for (;;) {
|
||||
int option;
|
||||
@ -158,21 +159,17 @@ static int builtin_hwdb(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
}
|
||||
|
||||
/* query a specific key given as argument */
|
||||
if (argv[optind]) {
|
||||
if (udev_builtin_hwdb_lookup(dev, prefix, argv[optind], filter, test) > 0)
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (argv[optind])
|
||||
return udev_builtin_hwdb_lookup(dev, prefix, argv[optind], filter, test);
|
||||
|
||||
/* read data from another device than the device we will store the data */
|
||||
if (device)
|
||||
if (sd_device_new_from_device_id(&srcdev, device) < 0)
|
||||
return EXIT_FAILURE;
|
||||
if (device) {
|
||||
r = sd_device_new_from_device_id(&srcdev, device);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (udev_builtin_hwdb_search(dev, srcdev, subsystem, prefix, filter, test) > 0)
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
return EXIT_FAILURE;
|
||||
return udev_builtin_hwdb_search(dev, srcdev, subsystem, prefix, filter, test);
|
||||
}
|
||||
|
||||
/* called at udev startup and reload */
|
||||
|
@ -354,7 +354,7 @@ static int builtin_input_id(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
startswith(sysname, "event"))
|
||||
extract_info(dev, devnode, test);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const struct udev_builtin udev_builtin_input_id = {
|
||||
|
@ -195,8 +195,7 @@ static int builtin_keyboard(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
const char *s = NULL;
|
||||
|
||||
(void) sd_device_get_syspath(dev, &s);
|
||||
log_error_errno(r, "No device node for \"%s\": %m", strnull(s));
|
||||
return EXIT_FAILURE;
|
||||
return log_error_errno(r, "No device node for \"%s\": %m", strnull(s));
|
||||
}
|
||||
|
||||
FOREACH_DEVICE_PROPERTY(dev, key, value) {
|
||||
@ -228,7 +227,7 @@ static int builtin_keyboard(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
if (fd == -1) {
|
||||
fd = open_device(node);
|
||||
if (fd < 0)
|
||||
return EXIT_FAILURE;
|
||||
return fd;
|
||||
}
|
||||
|
||||
map_keycode(fd, node, scancode, keycode);
|
||||
@ -245,7 +244,7 @@ static int builtin_keyboard(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
if (fd == -1) {
|
||||
fd = open_device(node);
|
||||
if (fd < 0)
|
||||
return EXIT_FAILURE;
|
||||
return fd;
|
||||
}
|
||||
|
||||
if (has_abs == -1) {
|
||||
@ -253,10 +252,8 @@ static int builtin_keyboard(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
int rc;
|
||||
|
||||
rc = ioctl(fd, EVIOCGBIT(0, sizeof(bits)), &bits);
|
||||
if (rc < 0) {
|
||||
log_error_errno(errno, "Unable to EVIOCGBIT device \"%s\"", node);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (rc < 0)
|
||||
return log_error_errno(errno, "Unable to EVIOCGBIT device \"%s\"", node);
|
||||
|
||||
has_abs = !!(bits & (1 << EV_ABS));
|
||||
if (!has_abs)
|
||||
@ -275,7 +272,7 @@ static int builtin_keyboard(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
if (release_count > 0)
|
||||
install_force_release(dev, release, release_count);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const struct udev_builtin udev_builtin_keyboard = {
|
||||
|
@ -29,13 +29,13 @@ static int builtin_kmod(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
|
||||
if (argc < 3 || !streq(argv[1], "load")) {
|
||||
log_error("%s: expected: load <module>", argv[0]);
|
||||
return EXIT_FAILURE;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
for (i = 2; argv[i]; i++)
|
||||
(void) module_load_and_warn(ctx, argv[i], false);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* called at udev startup and reload */
|
||||
|
@ -813,7 +813,7 @@ static int builtin_net_id(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
/* handle only ARPHRD_ETHER, ARPHRD_SLIP and ARPHRD_INFINIBAND devices */
|
||||
r = sd_device_get_sysattr_value(dev, "type", &s);
|
||||
if (r < 0)
|
||||
return EXIT_FAILURE;
|
||||
return r;
|
||||
|
||||
i = strtoul(s, NULL, 0);
|
||||
switch (i) {
|
||||
@ -833,10 +833,10 @@ static int builtin_net_id(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
/* skip stacked devices, like VLANs, ... */
|
||||
r = sd_device_get_sysattr_value(dev, "ifindex", &s);
|
||||
if (r < 0)
|
||||
return EXIT_FAILURE;
|
||||
return r;
|
||||
r = sd_device_get_sysattr_value(dev, "iflink", &p);
|
||||
if (r < 0)
|
||||
return EXIT_FAILURE;
|
||||
return r;
|
||||
if (!streq(s, p))
|
||||
return 0;
|
||||
|
||||
@ -865,7 +865,7 @@ static int builtin_net_id(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
|
||||
if (snprintf_ok(str, sizeof str, "%s%s", prefix, names.ccw_busid))
|
||||
udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
|
||||
goto out;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* get ibmveth/ibmvnic slot-based names. */
|
||||
@ -874,7 +874,7 @@ static int builtin_net_id(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
|
||||
if (snprintf_ok(str, sizeof str, "%s%s", prefix, names.vio_slot))
|
||||
udev_builtin_add_property(dev, test, "ID_NET_NAME_SLOT", str);
|
||||
goto out;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* get ACPI path names for ARM64 platform devices */
|
||||
@ -883,12 +883,12 @@ static int builtin_net_id(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
|
||||
if (snprintf_ok(str, sizeof str, "%s%s", prefix, names.platform_path))
|
||||
udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
|
||||
goto out;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* get PCI based path names, we compose only PCI based paths */
|
||||
if (names_pci(dev, &names) < 0)
|
||||
goto out;
|
||||
return 0;
|
||||
|
||||
/* plain PCI device */
|
||||
if (names.type == NET_PCI) {
|
||||
@ -909,7 +909,7 @@ static int builtin_net_id(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
if (names.pci_slot[0] &&
|
||||
snprintf_ok(str, sizeof str, "%s%s", prefix, names.pci_slot))
|
||||
udev_builtin_add_property(dev, test, "ID_NET_NAME_SLOT", str);
|
||||
goto out;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* USB device */
|
||||
@ -923,7 +923,7 @@ static int builtin_net_id(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
if (names.pci_slot[0] &&
|
||||
snprintf_ok(str, sizeof str, "%s%s%s", prefix, names.pci_slot, names.usb_ports))
|
||||
udev_builtin_add_property(dev, test, "ID_NET_NAME_SLOT", str);
|
||||
goto out;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Broadcom bus */
|
||||
@ -937,11 +937,10 @@ static int builtin_net_id(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
if (names.pci_slot[0] &&
|
||||
snprintf(str, sizeof str, "%s%s%s", prefix, names.pci_slot, names.bcma_core))
|
||||
udev_builtin_add_property(dev, test, "ID_NET_NAME_SLOT", str);
|
||||
goto out;
|
||||
return 0;
|
||||
}
|
||||
|
||||
out:
|
||||
return EXIT_SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const struct udev_builtin udev_builtin_net_id = {
|
||||
|
@ -16,7 +16,7 @@ static int builtin_net_setup_link(sd_device *dev, int argc, char **argv, bool te
|
||||
|
||||
if (argc > 1) {
|
||||
log_error("This program takes no arguments.");
|
||||
return EXIT_FAILURE;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
r = link_get_driver(ctx, dev, &driver);
|
||||
@ -25,13 +25,10 @@ static int builtin_net_setup_link(sd_device *dev, int argc, char **argv, bool te
|
||||
|
||||
r = link_config_get(ctx, dev, &link);
|
||||
if (r < 0) {
|
||||
if (r == -ENOENT) {
|
||||
log_debug("No matching link configuration found.");
|
||||
return EXIT_SUCCESS;
|
||||
} else {
|
||||
log_error_errno(r, "Could not get link config: %m");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (r == -ENOENT)
|
||||
return log_debug_errno(r, "No matching link configuration found.");
|
||||
|
||||
return log_error_errno(r, "Could not get link config: %m");
|
||||
}
|
||||
|
||||
r = link_config_apply(ctx, link, dev, &name);
|
||||
@ -47,7 +44,7 @@ static int builtin_net_setup_link(sd_device *dev, int argc, char **argv, bool te
|
||||
if (name)
|
||||
udev_builtin_add_property(dev, test, "ID_NET_NAME", name);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int builtin_net_setup_link_init(void) {
|
||||
|
@ -619,7 +619,7 @@ static int builtin_path_id(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
}
|
||||
|
||||
if (!path)
|
||||
return EXIT_FAILURE;
|
||||
return -ENOENT;
|
||||
|
||||
/*
|
||||
* Do not return devices with an unknown parent device type. They
|
||||
@ -627,7 +627,7 @@ static int builtin_path_id(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
* unique and predictable name.
|
||||
*/
|
||||
if (!supported_parent)
|
||||
return EXIT_FAILURE;
|
||||
return -ENOENT;
|
||||
|
||||
/*
|
||||
* Do not return block devices without a well-known transport. Some
|
||||
@ -637,7 +637,7 @@ static int builtin_path_id(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
if (sd_device_get_subsystem(dev, &subsystem) >= 0 &&
|
||||
streq(subsystem, "block") &&
|
||||
!supported_transport)
|
||||
return EXIT_FAILURE;
|
||||
return -ENOENT;
|
||||
|
||||
{
|
||||
char tag[UTIL_NAME_SIZE];
|
||||
@ -673,7 +673,7 @@ static int builtin_path_id(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
udev_builtin_add_property(dev, test, "ID_PATH_TAG", tag);
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const struct udev_builtin udev_builtin_path_id = {
|
||||
|
@ -35,12 +35,13 @@ static int builtin_uaccess(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
seat = "seat0";
|
||||
|
||||
r = sd_seat_get_active(seat, NULL, &uid);
|
||||
if (IN_SET(r, -ENXIO, -ENODATA)) {
|
||||
/* No active session on this seat */
|
||||
r = 0;
|
||||
goto finish;
|
||||
} else if (r < 0) {
|
||||
log_error("Failed to determine active user on seat %s.", seat);
|
||||
if (r < 0) {
|
||||
if (IN_SET(r, -ENXIO, -ENODATA))
|
||||
/* No active session on this seat */
|
||||
r = 0;
|
||||
else
|
||||
log_error_errno(r, "Failed to determine active user on seat %s: %m", seat);
|
||||
|
||||
goto finish;
|
||||
}
|
||||
|
||||
@ -66,7 +67,7 @@ finish:
|
||||
}
|
||||
}
|
||||
|
||||
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
||||
return r;
|
||||
}
|
||||
|
||||
const struct udev_builtin udev_builtin_uaccess = {
|
||||
|
@ -253,11 +253,11 @@ static int builtin_usb_id(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
|
||||
r = sd_device_get_syspath(dev, &syspath);
|
||||
if (r < 0)
|
||||
return EXIT_FAILURE;
|
||||
return r;
|
||||
|
||||
r = sd_device_get_sysname(dev, &sysname);
|
||||
if (r < 0)
|
||||
return EXIT_FAILURE;
|
||||
return r;
|
||||
|
||||
/* shortcut, if we are called directly for a "usb_device" type */
|
||||
if (sd_device_get_devtype(dev, &devtype) >= 0 && streq(devtype, "usb_device")) {
|
||||
@ -268,22 +268,18 @@ static int builtin_usb_id(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
|
||||
/* usb interface directory */
|
||||
r = sd_device_get_parent_with_subsystem_devtype(dev, "usb", "usb_interface", &dev_interface);
|
||||
if (r < 0) {
|
||||
log_debug_errno(r, "Failed to access usb_interface device of '%s': %m", syspath);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (r < 0)
|
||||
return log_debug_errno(r, "Failed to access usb_interface device of '%s': %m", syspath);
|
||||
|
||||
r = sd_device_get_syspath(dev_interface, &interface_syspath);
|
||||
if (r < 0)
|
||||
return EXIT_FAILURE;
|
||||
return r;
|
||||
(void) sd_device_get_sysattr_value(dev_interface, "bInterfaceNumber", &ifnum);
|
||||
(void) sd_device_get_sysattr_value(dev_interface, "driver", &driver);
|
||||
|
||||
r = sd_device_get_sysattr_value(dev_interface, "bInterfaceClass", &if_class);
|
||||
if (r < 0) {
|
||||
log_debug_errno(r, "Failed to get bInterfaceClass attribute of '%s': %m", sysname);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (r < 0)
|
||||
return log_debug_errno(r, "Failed to get bInterfaceClass attribute of '%s': %m", sysname);
|
||||
|
||||
if_class_num = strtoul(if_class, NULL, 16);
|
||||
if (if_class_num == 8) {
|
||||
@ -297,10 +293,8 @@ static int builtin_usb_id(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
|
||||
/* usb device directory */
|
||||
r = sd_device_get_parent_with_subsystem_devtype(dev_interface, "usb", "usb_device", &dev_usb);
|
||||
if (r < 0) {
|
||||
log_debug_errno(r, "Failed to find parent 'usb' device of '%s'", syspath);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (r < 0)
|
||||
return log_debug_errno(r, "Failed to find parent 'usb' device of '%s'", syspath);
|
||||
|
||||
/* all interfaces of the device in a single string */
|
||||
dev_if_packed_info(dev_usb, packed_if_str, sizeof(packed_if_str));
|
||||
@ -368,11 +362,11 @@ static int builtin_usb_id(sd_device *dev, int argc, char *argv[], bool test) {
|
||||
fallback:
|
||||
r = sd_device_get_sysattr_value(dev_usb, "idVendor", &vendor_id);
|
||||
if (r < 0)
|
||||
return EXIT_FAILURE;
|
||||
return r;
|
||||
|
||||
r = sd_device_get_sysattr_value(dev_usb, "idProduct", &product_id);
|
||||
if (r < 0)
|
||||
return EXIT_FAILURE;
|
||||
return r;
|
||||
|
||||
/* fallback to USB vendor & device */
|
||||
if (vendor_str[0] == '\0') {
|
||||
@ -380,10 +374,6 @@ fallback:
|
||||
|
||||
if (sd_device_get_sysattr_value(dev_usb, "manufacturer", &usb_vendor) < 0)
|
||||
usb_vendor = vendor_id;
|
||||
if (!usb_vendor) {
|
||||
log_debug("No USB vendor information available");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
udev_util_encode_string(usb_vendor, vendor_str_enc, sizeof(vendor_str_enc));
|
||||
util_replace_whitespace(usb_vendor, vendor_str, sizeof(vendor_str)-1);
|
||||
util_replace_chars(vendor_str, NULL);
|
||||
@ -394,8 +384,6 @@ fallback:
|
||||
|
||||
if (sd_device_get_sysattr_value(dev_usb, "product", &usb_model) < 0)
|
||||
usb_model = product_id;
|
||||
if (!usb_model)
|
||||
return EXIT_FAILURE;
|
||||
udev_util_encode_string(usb_model, model_str_enc, sizeof(model_str_enc));
|
||||
util_replace_whitespace(usb_model, model_str, sizeof(model_str)-1);
|
||||
util_replace_chars(model_str, NULL);
|
||||
@ -459,7 +447,7 @@ fallback:
|
||||
udev_builtin_add_property(dev, test, "ID_USB_INTERFACE_NUM", ifnum);
|
||||
if (driver)
|
||||
udev_builtin_add_property(dev, test, "ID_USB_DRIVER", driver);
|
||||
return EXIT_SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const struct udev_builtin udev_builtin_usb_id = {
|
||||
|
@ -2015,10 +2015,11 @@ int udev_rules_apply_to_event(
|
||||
rules_str(rules, rule->rule.filename_off),
|
||||
rule->rule.filename_line);
|
||||
|
||||
if (udev_builtin_run(event->dev->device, cur->key.builtin_cmd, command, false) != 0) {
|
||||
r = udev_builtin_run(event->dev->device, cur->key.builtin_cmd, command, false);
|
||||
if (r < 0) {
|
||||
/* remember failure */
|
||||
log_debug("IMPORT builtin '%s' returned non-zero",
|
||||
udev_builtin_name(cur->key.builtin_cmd));
|
||||
log_debug_errno(r, "IMPORT builtin '%s' fails: %m",
|
||||
udev_builtin_name(cur->key.builtin_cmd));
|
||||
event->builtin_ret |= (1 << cur->key.builtin_cmd);
|
||||
if (cur->key.op != OP_NOMATCH)
|
||||
goto nomatch;
|
||||
|
@ -91,7 +91,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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user