From 2807a79424a0be807bc904ca145f1db03ac7fbb0 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 9 Sep 2020 00:22:21 +0900 Subject: [PATCH] sd-device-monitor: use fd_set_rcvbuf() --- src/libsystemd/sd-device/device-monitor.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/libsystemd/sd-device/device-monitor.c b/src/libsystemd/sd-device/device-monitor.c index cb6f1a70f8..43646e1880 100644 --- a/src/libsystemd/sd-device/device-monitor.c +++ b/src/libsystemd/sd-device/device-monitor.c @@ -91,18 +91,9 @@ int device_monitor_allow_unicast_sender(sd_device_monitor *m, sd_device_monitor } _public_ int sd_device_monitor_set_receive_buffer_size(sd_device_monitor *m, size_t size) { - int r, n = (int) size; - assert_return(m, -EINVAL); - assert_return((size_t) n == size, -EINVAL); - - if (setsockopt_int(m->sock, SOL_SOCKET, SO_RCVBUFFORCE, n) < 0) { - r = setsockopt_int(m->sock, SOL_SOCKET, SO_RCVBUF, n); - if (r < 0) - return r; - } - return 0; + return fd_set_rcvbuf(m->sock, size, false); } int device_monitor_disconnect(sd_device_monitor *m) { -- 2.25.1