/* let the executed programs know if we handle the whole hotplug event */
managed_event = manage_hotplug_event();
if (managed_event)
/* let the executed programs know if we handle the whole hotplug event */
managed_event = manage_hotplug_event();
if (managed_event)
if (strcmp(action, "add") == 0) {
/* wait for sysfs and possibly add node */
dbg("udev add");
/* skip subsystems without "dev", but handle net devices */
if (strcmp(action, "add") == 0) {
/* wait for sysfs and possibly add node */
dbg("udev add");
/* skip subsystems without "dev", but handle net devices */
- snprintf(path, SYSFS_PATH_MAX, "%s%s", sysfs_path, udev.devpath);
+ snprintf(path, sizeof(path), "%s%s", sysfs_path, udev.devpath);
+ path[sizeof(path)-1] = '\0';
- snprintf(path, SYSFS_PATH_MAX, "%s%s", sysfs_path, devpath);
+ snprintf(path, sizeof(path), "%s%s", sysfs_path, devpath);
+ path[sizeof(path)-1] = '\0';
devices_dev = wait_devices_device_open(path);
if (!devices_dev) {
dbg("devices device unavailable (probably remove has beaten us)");
devices_dev = wait_devices_device_open(path);
if (!devices_dev) {
dbg("devices device unavailable (probably remove has beaten us)");
if (udev_hotplug_d && managed_event)
udev_multiplex_directory(&udev, HOTPLUGD_DIR, HOTPLUG_SUFFIX);
if (udev_hotplug_d && managed_event)
udev_multiplex_directory(&udev, HOTPLUGD_DIR, HOTPLUG_SUFFIX);