]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device-monitor: rename device_monitor_send_device() -> device_monitor_send()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 31 Jul 2024 05:21:33 +0000 (14:21 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 2 Aug 2024 02:22:24 +0000 (11:22 +0900)
src/libsystemd/sd-device/device-monitor-private.h
src/libsystemd/sd-device/device-monitor.c
src/libsystemd/sd-device/test-sd-device-monitor.c
src/udev/udev-manager.c
src/udev/udev-worker.c

index af7dd2ec356c83ff63982401918639731eeb2ada..79f9d834ff3bd91e940203f61576d14bc67aaa0d 100644 (file)
@@ -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);
index 002edd4f96b6e805ad59f37cc48eace7799139e7..9d598f5ac1712993dc09bdb3fa3e99141e780436 100644 (file)
@@ -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) {
index a64f2b4b84377fd584e9420e967570eac93bcc8a..4beab76b4d6bd1826863213af95bce0a9e2159ab 100644 (file)
@@ -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 (;;) {
index 5d0d6543c7949da355ceda341d15c55adba9fe26..cc8f7fdf8ff91840a76e66598e17b5070d614cc5 100644 (file)
@@ -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);
index 97c5679b74ca5e487e68722fb5f25613e100948a..5577f5fab8d8733e582b8babde442575c7961455 100644 (file)
@@ -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");