diff options
Diffstat (limited to 'io/channel-socket.c')
-rw-r--r-- | io/channel-socket.c | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/io/channel-socket.c b/io/channel-socket.c index 45df819a82..f385233f18 100644 --- a/io/channel-socket.c +++ b/io/channel-socket.c @@ -156,19 +156,16 @@ int qio_channel_socket_connect_sync(QIOChannelSocket *ioc, } -static int qio_channel_socket_connect_worker(QIOTask *task, - Error **errp, - gpointer opaque) +static void qio_channel_socket_connect_worker(QIOTask *task, + gpointer opaque) { QIOChannelSocket *ioc = QIO_CHANNEL_SOCKET(qio_task_get_source(task)); SocketAddress *addr = opaque; - int ret; + Error *err = NULL; - ret = qio_channel_socket_connect_sync(ioc, - addr, - errp); + qio_channel_socket_connect_sync(ioc, addr, &err); - return ret; + qio_task_set_error(task, err); } @@ -218,19 +215,16 @@ int qio_channel_socket_listen_sync(QIOChannelSocket *ioc, } -static int qio_channel_socket_listen_worker(QIOTask *task, - Error **errp, - gpointer opaque) +static void qio_channel_socket_listen_worker(QIOTask *task, + gpointer opaque) { QIOChannelSocket *ioc = QIO_CHANNEL_SOCKET(qio_task_get_source(task)); SocketAddress *addr = opaque; - int ret; + Error *err = NULL; - ret = qio_channel_socket_listen_sync(ioc, - addr, - errp); + qio_channel_socket_listen_sync(ioc, addr, &err); - return ret; + qio_task_set_error(task, err); } @@ -293,21 +287,18 @@ static void qio_channel_socket_dgram_worker_free(gpointer opaque) g_free(data); } -static int qio_channel_socket_dgram_worker(QIOTask *task, - Error **errp, - gpointer opaque) +static void qio_channel_socket_dgram_worker(QIOTask *task, + gpointer opaque) { QIOChannelSocket *ioc = QIO_CHANNEL_SOCKET(qio_task_get_source(task)); struct QIOChannelSocketDGramWorkerData *data = opaque; - int ret; + Error *err = NULL; /* socket_dgram() blocks in DNS lookups, so we must use a thread */ - ret = qio_channel_socket_dgram_sync(ioc, - data->localAddr, - data->remoteAddr, - errp); + qio_channel_socket_dgram_sync(ioc, data->localAddr, + data->remoteAddr, &err); - return ret; + qio_task_set_error(task, err); } |