diff options
| author | Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> | 2025-09-16 16:13:53 +0300 |
|---|---|---|
| committer | Daniel P. Berrangé <berrange@redhat.com> | 2025-09-19 12:46:07 +0100 |
| commit | 1ed8903916394fca2347c700da974ca3856274b2 (patch) | |
| tree | a8b066c5470b55629ebe1dc783fe375fa405db02 /io/channel-websock.c | |
| parent | 4149afca711cc735a84ad61314bdcf41f69a7607 (diff) | |
| download | focaccia-qemu-1ed8903916394fca2347c700da974ca3856274b2.tar.gz focaccia-qemu-1ed8903916394fca2347c700da974ca3856274b2.zip | |
treewide: handle result of qio_channel_set_blocking()
Currently, we just always pass NULL as errp argument. That doesn't
look good.
Some realizations of interface may actually report errors.
Channel-socket realization actually either ignore or crash on
errors, but we are going to straighten it out to always reporting
an errp in further commits.
So, convert all callers to either handle the error (where environment
allows) or explicitly use &error_abort.
Take also a chance to change the return value to more convenient
bool (keeping also in mind, that underlying realizations may
return -1 on failure, not -errno).
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
[DB: fix return type mismatch in TLS/websocket channel
impls for qio_channel_set_blocking]
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'io/channel-websock.c')
| -rw-r--r-- | io/channel-websock.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/io/channel-websock.c b/io/channel-websock.c index 08ddb274f0..0a8c5c4712 100644 --- a/io/channel-websock.c +++ b/io/channel-websock.c @@ -1184,8 +1184,7 @@ static int qio_channel_websock_set_blocking(QIOChannel *ioc, { QIOChannelWebsock *wioc = QIO_CHANNEL_WEBSOCK(ioc); - qio_channel_set_blocking(wioc->master, enabled, errp); - return 0; + return qio_channel_set_blocking(wioc->master, enabled, errp) ? 0 : -1; } static void qio_channel_websock_set_delay(QIOChannel *ioc, |