diff --git a/src/libsystemd/sd-device/device-monitor-private.h b/src/libsystemd/sd-device/device-monitor-private.h index af7dd2ec356..79f9d834ff3 100644 --- a/src/libsystemd/sd-device/device-monitor-private.h +++ b/src/libsystemd/sd-device/device-monitor-private.h @@ -18,4 +18,4 @@ typedef enum MonitorNetlinkGroup { int device_monitor_new_full(sd_device_monitor **ret, MonitorNetlinkGroup group, int fd); int device_monitor_get_address(sd_device_monitor *m, union sockaddr_union *ret); int device_monitor_allow_unicast_sender(sd_device_monitor *m, sd_device_monitor *sender); -int device_monitor_send_device(sd_device_monitor *m, const union sockaddr_union *destination, sd_device *device); +int device_monitor_send(sd_device_monitor *m, const union sockaddr_union *destination, sd_device *device); diff --git a/src/libsystemd/sd-device/device-monitor.c b/src/libsystemd/sd-device/device-monitor.c index 002edd4f96b..9d598f5ac17 100644 --- a/src/libsystemd/sd-device/device-monitor.c +++ b/src/libsystemd/sd-device/device-monitor.c @@ -686,7 +686,7 @@ static uint64_t string_bloom64(const char *str) { return bits; } -int device_monitor_send_device( +int device_monitor_send( sd_device_monitor *m, const union sockaddr_union *destination, sd_device *device) { diff --git a/src/libsystemd/sd-device/test-sd-device-monitor.c b/src/libsystemd/sd-device/test-sd-device-monitor.c index a64f2b4b843..4beab76b4d6 100644 --- a/src/libsystemd/sd-device/test-sd-device-monitor.c +++ b/src/libsystemd/sd-device/test-sd-device-monitor.c @@ -91,11 +91,11 @@ static void send_by_enumerator( ASSERT_OK(device_add_property(d, "SEQNUM", "10")); log_device_debug(d, "Sending device subsystem:%s syspath:%s", s, p); - ASSERT_OK(device_monitor_send_device(monitor_server, address, d)); + ASSERT_OK(device_monitor_send(monitor_server, address, d)); /* The sysattr and parent filters are not implemented in BPF yet. So, sending multiple - * devices may fills up buffer and device_monitor_send_device() may return EAGAIN. Let's - * send only a few devices here, which should be filtered out by the receiver. */ + * devices may fills up buffer and device_monitor_send() may return EAGAIN. Let's send only a + * few devices here, which should be filtered out by the receiver. */ if (n != SIZE_MAX && ++i >= n) break; } @@ -129,7 +129,7 @@ TEST(refuse_invalid_device) { prepare_monitor(&monitor_server, &monitor_client, &sa); ASSERT_OK(sd_device_monitor_start(monitor_client, monitor_handler, (void *) syspath)); - ASSERT_OK(device_monitor_send_device(monitor_server, &sa, loopback)); + ASSERT_OK(device_monitor_send(monitor_server, &sa, loopback)); ASSERT_OK(sd_event_run(sd_device_monitor_get_event(monitor_client), 0)); } @@ -159,7 +159,7 @@ static void test_send_receive_one(sd_device *device, bool subsystem_filter, bool ASSERT_OK(sd_device_monitor_filter_update(monitor_client)); ASSERT_OK(sd_device_monitor_start(monitor_client, monitor_handler, (void *) syspath)); - ASSERT_OK(device_monitor_send_device(monitor_server, &sa, device)); + ASSERT_OK(device_monitor_send(monitor_server, &sa, device)); ASSERT_EQ(sd_event_loop(sd_device_monitor_get_event(monitor_client)), 100); } @@ -211,7 +211,7 @@ TEST(sd_device_monitor_filter_add_match_subsystem_devtype) { send_by_enumerator(monitor_server, &sa, e, SIZE_MAX, NULL); log_device_info(device, "Sending device subsystem:%s syspath:%s", subsystem, syspath); - ASSERT_OK(device_monitor_send_device(monitor_server, &sa, device)); + ASSERT_OK(device_monitor_send(monitor_server, &sa, device)); ASSERT_EQ(sd_event_loop(sd_device_monitor_get_event(monitor_client)), 100); } @@ -235,7 +235,7 @@ TEST(sd_device_monitor_filter_add_match_tag) { send_by_enumerator(monitor_server, &sa, e, SIZE_MAX, NULL); log_device_info(device, "Sending device syspath:%s", syspath); - ASSERT_OK(device_monitor_send_device(monitor_server, &sa, device)); + ASSERT_OK(device_monitor_send(monitor_server, &sa, device)); ASSERT_EQ(sd_event_loop(sd_device_monitor_get_event(monitor_client)), 100); } @@ -262,7 +262,7 @@ TEST(sd_device_monitor_filter_add_match_sysattr) { send_by_enumerator(monitor_server, &sa, e, 5, NULL); log_device_info(device, "Sending device syspath:%s", syspath); - ASSERT_OK(device_monitor_send_device(monitor_server, &sa, device)); + ASSERT_OK(device_monitor_send(monitor_server, &sa, device)); ASSERT_EQ(sd_event_loop(sd_device_monitor_get_event(monitor_client)), 100); } @@ -296,7 +296,7 @@ TEST(sd_device_monitor_add_match_parent) { send_by_enumerator(monitor_server, &sa, e, 5, parent_syspath); log_device_info(device, "Sending device syspath:%s", syspath); - ASSERT_OK(device_monitor_send_device(monitor_server, &sa, device)); + ASSERT_OK(device_monitor_send(monitor_server, &sa, device)); ASSERT_EQ(sd_event_loop(sd_device_monitor_get_event(monitor_client)), 100); } @@ -315,12 +315,12 @@ TEST(sd_device_monitor_filter_remove) { ASSERT_OK(sd_device_monitor_filter_add_match_subsystem_devtype(monitor_client, "hoge", NULL)); ASSERT_OK(sd_device_monitor_start(monitor_client, monitor_handler, (void *) syspath)); - ASSERT_OK(device_monitor_send_device(monitor_server, &sa, device)); + ASSERT_OK(device_monitor_send(monitor_server, &sa, device)); ASSERT_OK(sd_event_run(sd_device_monitor_get_event(monitor_client), 0)); ASSERT_OK(sd_device_monitor_filter_remove(monitor_client)); - ASSERT_OK(device_monitor_send_device(monitor_server, &sa, device)); + ASSERT_OK(device_monitor_send(monitor_server, &sa, device)); ASSERT_EQ(sd_event_loop(sd_device_monitor_get_event(monitor_client)), 100); } @@ -337,7 +337,7 @@ TEST(sd_device_monitor_receive) { prepare_monitor(&monitor_server, &monitor_client, &sa); - ASSERT_OK(device_monitor_send_device(monitor_server, &sa, device)); + ASSERT_OK(device_monitor_send(monitor_server, &sa, device)); ASSERT_OK(fd = sd_device_monitor_get_fd(monitor_client)); for (;;) { diff --git a/src/udev/udev-manager.c b/src/udev/udev-manager.c index 5d0d6543c79..cc8f7fdf8ff 100644 --- a/src/udev/udev-manager.c +++ b/src/udev/udev-manager.c @@ -450,7 +450,7 @@ static int event_run(Event *event) { if (worker->state != WORKER_IDLE) continue; - r = device_monitor_send_device(manager->monitor, &worker->address, event->dev); + r = device_monitor_send(manager->monitor, &worker->address, event->dev); if (r < 0) { log_device_error_errno(event->dev, r, "Worker ["PID_FMT"] did not accept message, killing the worker: %m", worker->pid); diff --git a/src/udev/udev-worker.c b/src/udev/udev-worker.c index 97c5679b74c..5577f5fab8d 100644 --- a/src/udev/udev-worker.c +++ b/src/udev/udev-worker.c @@ -272,7 +272,7 @@ void udev_broadcast_result(sd_device_monitor *monitor, sd_device *dev, EventResu } } - r = device_monitor_send_device(monitor, NULL, dev); + r = device_monitor_send(monitor, NULL, dev); if (r < 0) log_device_warning_errno(dev, r, "Failed to broadcast event to libudev listeners, ignoring: %m");