]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
char-socket: tcp_chr_recv(): drop extra _set_(block,cloexec)
authorVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Tue, 16 Sep 2025 13:13:50 +0000 (16:13 +0300)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 19 Sep 2025 11:46:06 +0000 (12:46 +0100)
qio_channel_readv_full() guarantees BLOCKING and CLOEXEC states for
incoming descriptors, no reason to call extra ioctls.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
chardev/char-socket.c

index 1e8313915b54050c4c46199af28966e884ad48c6..b1ce5d01c7b7a870e2a892f43aa4a95b0d1b0eb3 100644 (file)
@@ -307,20 +307,6 @@ static ssize_t tcp_chr_recv(Chardev *chr, char *buf, size_t len)
         s->read_msgfds_num = msgfds_num;
     }
 
-    for (i = 0; i < s->read_msgfds_num; i++) {
-        int fd = s->read_msgfds[i];
-        if (fd < 0) {
-            continue;
-        }
-
-        /* O_NONBLOCK is preserved across SCM_RIGHTS so reset it */
-        qemu_socket_set_block(fd);
-
-#ifndef MSG_CMSG_CLOEXEC
-        qemu_set_cloexec(fd);
-#endif
-    }
-
     if (ret == QIO_CHANNEL_ERR_BLOCK) {
         errno = EAGAIN;
         ret = -1;