From: Yu Watanabe Date: Tue, 8 Sep 2020 15:22:21 +0000 (+0900) Subject: sd-device-monitor: use fd_set_rcvbuf() X-Git-Tag: v247-rc1~278^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2807a79424a0be807bc904ca145f1db03ac7fbb0;p=thirdparty%2Fsystemd.git sd-device-monitor: use fd_set_rcvbuf() --- diff --git a/src/libsystemd/sd-device/device-monitor.c b/src/libsystemd/sd-device/device-monitor.c index cb6f1a70f89..43646e18809 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) {