mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:10 +00:00
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é <berrange@redhat.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
committed by
Daniel P. Berrangé
parent
d343f395e3
commit
6e9a6d57bf
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user