- udev_set_log_priority(udev, prio);
- } else if (startswith(opt, "udev.children-max=")) {
- arg_children_max = strtoul(opt + 18, NULL, 0);
- } else if (startswith(opt, "udev.exec-delay=")) {
- arg_exec_delay = strtoul(opt + 16, NULL, 0);
- } else if (startswith(opt, "udev.event-timeout=")) {
- arg_event_timeout_usec = strtoul(opt + 16, NULL, 0) * USEC_PER_SEC;
+ } else if ((value = startswith(opt, "udev.children-max="))) {
+ r = safe_atoi(value, &arg_children_max);
+ if (r < 0)
+ log_warning("Invalid udev.children-max ignored: %s", value);
+ } else if ((value = startswith(opt, "udev.exec-delay="))) {
+ r = safe_atoi(value, &arg_exec_delay);
+ if (r < 0)
+ log_warning("Invalid udev.exec-delay ignored: %s", value);
+ } else if ((value = startswith(opt, "udev.event-timeout="))) {
+ r = safe_atou64(value, &arg_event_timeout_usec);
+ if (r < 0) {
+ log_warning("Invalid udev.event-timeout ignored: %s", value);
+ break;
+ }
+ arg_event_timeout_usec *= USEC_PER_SEC;