From: Vladimir Sementsov-Ogievskiy Date: Tue, 16 Sep 2025 13:13:50 +0000 (+0300) Subject: char-socket: tcp_chr_recv(): drop extra _set_(block,cloexec) X-Git-Tag: v10.2.0-rc1~99^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e9a6d57bf8de9e1edc207c24ed4e9e9508838c1;p=thirdparty%2Fqemu.git char-socket: tcp_chr_recv(): drop extra _set_(block,cloexec) qio_channel_readv_full() guarantees BLOCKING and CLOEXEC states for incoming descriptors, no reason to call extra ioctls. Reviewed-by: Daniel P. Berrangé Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Daniel P. Berrangé --- diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 1e8313915b5..b1ce5d01c7b 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -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;