]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
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)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 20 Jun 2018 14:12:55 +0000 (16:12 +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/core/dynamic-user.c
src/coredump/coredump.c
src/libsystemd/sd-bus/bus-socket.c
src/portable/portable.c

index 69f2c41e9d336f5d8b24378b06a6fee8448744f5..a913102e13c52fff5e5d36efe4478ed77de71200 100644 (file)
@@ -1058,7 +1058,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 270b4eb8fa021264e827b48defbbfacb8a9c53f5..7c5111ddf640e486939a7e21e260051dad9b5655 100644 (file)
@@ -334,7 +334,7 @@ static int dynamic_user_pop(DynamicUser *d, uid_t *ret_uid, int *ret_lock_fd) {
         /* Read the UID and lock fd that is stored in the storage AF_UNIX socket. This should be called with the lock
          * on the socket taken. */
 
-        k = recvmsg(d->storage_socket[0], &mh, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC);
+        k = recvmsg(d->storage_socket[0], &mh, MSG_DONTWAIT|MSG_CMSG_CLOEXEC);
         if (k < 0)
                 return -errno;
 
index d2b4ba2a21bd71e7505e3611b132454c85077d26..20a1cbdd450c40ffa595ed5da8c0108bbbbae9e3 100644 (file)
@@ -912,7 +912,7 @@ static int process_socket(int fd) {
 
                 mh.msg_iov = iovec + n_iovec;
 
-                n = recvmsg(fd, &mh, MSG_NOSIGNAL|MSG_CMSG_CLOEXEC);
+                n = recvmsg(fd, &mh, MSG_CMSG_CLOEXEC);
                 if (n < 0)  {
                         free(iovec[n_iovec].iov_base);
                         r = log_error_errno(errno, "Failed to receive datagram: %m");
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);
index eac0a4d616ee1686a5023f485d3e8056fbc9a596..eb5daf3b0e1a27045f34ccb99818fd03ce6a64d6 100644 (file)
@@ -201,7 +201,7 @@ static int recv_item(
         assert(ret_name);
         assert(ret_fd);
 
-        n = recvmsg(socket_fd, &mh, MSG_NOSIGNAL|MSG_CMSG_CLOEXEC);
+        n = recvmsg(socket_fd, &mh, MSG_CMSG_CLOEXEC);
         if (n < 0)
                 return -errno;