]> git.proxmox.com Git - mirror_qemu.git/blobdiff - util/qemu-coroutine-io.c
CODING_STYLE: indent example code as all others
[mirror_qemu.git] / util / qemu-coroutine-io.c
index 0d5041c1c384e5d01b4219f447af38b817e35c51..44a8969a692fcc77196cc8d9baea7ef746b2638f 100644 (file)
@@ -35,18 +35,16 @@ qemu_co_sendv_recvv(int sockfd, struct iovec *iov, unsigned iov_cnt,
 {
     size_t done = 0;
     ssize_t ret;
-    int err;
     while (done < bytes) {
         ret = iov_send_recv(sockfd, iov, iov_cnt,
                             offset + done, bytes - done, do_send);
         if (ret > 0) {
             done += ret;
         } else if (ret < 0) {
-            err = socket_error();
-            if (err == EAGAIN || err == EWOULDBLOCK) {
+            if (errno == EAGAIN || errno == EWOULDBLOCK) {
                 qemu_coroutine_yield();
             } else if (done == 0) {
-                return -err;
+                return -errno;
             } else {
                 break;
             }
@@ -77,7 +75,7 @@ static void fd_coroutine_enter(void *opaque)
 {
     FDYieldUntilData *data = opaque;
     qemu_set_fd_handler(data->fd, NULL, NULL, NULL);
-    qemu_coroutine_enter(data->co, NULL);
+    qemu_coroutine_enter(data->co);
 }
 
 void coroutine_fn yield_until_fd_readable(int fd)