chiark / gitweb /
tree-wide: drop MSG_NOSIGNAL flag from recvmsg() invocations
authorLennart Poettering <lennart@poettering.net>
Wed, 20 Jun 2018 11:01:51 +0000 (13:01 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
MSG_NOSIGNAL is only defined for sendmsg(), not for recvmsg(), hence
let's drop it's use, in particular as it appears to create problems on
older kernels. See:

https://lists.freedesktop.org/archives/systemd-devel/2018-June/040869.html

src/basic/socket-util.c
src/libelogind/sd-bus/bus-socket.c

index f27816fdeec61c315efcfffbbc2ad5fa59829bdf..7958e815b85e5373b21e604ac178591752656782 100644 (file)
@@ -1085,7 +1085,7 @@ int receive_one_fd(int transport_fd, int flags) {
          * combination with send_one_fd().
          */
 
-        if (recvmsg(transport_fd, &mh, MSG_NOSIGNAL | MSG_CMSG_CLOEXEC | flags) < 0)
+        if (recvmsg(transport_fd, &mh, MSG_CMSG_CLOEXEC | flags) < 0)
                 return -errno;
 
         CMSG_FOREACH(cmsg, &mh) {
index 7303313635fac1806d7ff5b7e1d6fa1539554d8f..b147a3843aed11d40ca8c90cef6ae0cc4c6b9745 100644 (file)
@@ -533,7 +533,7 @@ static int bus_socket_read_auth(sd_bus *b) {
                 mh.msg_control = &control;
                 mh.msg_controllen = sizeof(control);
 
-                k = recvmsg(b->input_fd, &mh, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC);
+                k = recvmsg(b->input_fd, &mh, MSG_DONTWAIT|MSG_CMSG_CLOEXEC);
                 if (k < 0 && errno == ENOTSOCK) {
                         b->prefer_readv = true;
                         k = readv(b->input_fd, &iov, 1);
@@ -1163,7 +1163,7 @@ int bus_socket_read_message(sd_bus *bus) {
                 mh.msg_control = &control;
                 mh.msg_controllen = sizeof(control);
 
-                k = recvmsg(bus->input_fd, &mh, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC);
+                k = recvmsg(bus->input_fd, &mh, MSG_DONTWAIT|MSG_CMSG_CLOEXEC);
                 if (k < 0 && errno == ENOTSOCK) {
                         bus->prefer_readv = true;
                         k = readv(bus->input_fd, &iov, 1);