aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/libqmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qtest/libqmp.c')
-rw-r--r--tests/qtest/libqmp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/qtest/libqmp.c b/tests/qtest/libqmp.c
index ade26c15f0..2b08382e5d 100644
--- a/tests/qtest/libqmp.c
+++ b/tests/qtest/libqmp.c
@@ -23,6 +23,7 @@
#endif
#include "qemu/cutils.h"
+#include "qemu/sockets.h"
#include "qapi/error.h"
#include "qapi/qmp/json-parser.h"
#include "qapi/qmp/qjson.h"
@@ -36,7 +37,7 @@ typedef struct {
static void socket_send(int fd, const char *buf, size_t size)
{
- size_t res = qemu_write_full(fd, buf, size);
+ ssize_t res = qemu_send_full(fd, buf, size);
assert(res == size);
}
@@ -69,7 +70,7 @@ QDict *qmp_fd_receive(int fd)
ssize_t len;
char c;
- len = read(fd, &c, 1);
+ len = recv(fd, &c, 1, 0);
if (len == -1 && errno == EINTR) {
continue;
}