summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--tests/qtest/libqtest.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index 7db7ef3a68..5098d71485 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -612,10 +612,13 @@ QDict *qmp_fd_receive(int fd)
         }
 
         if (log) {
-            len = write(2, &c, 1);
+            g_assert(write(2, &c, 1) == 1);
         }
         json_message_parser_feed(&qmp.parser, &c, 1);
     }
+    if (log) {
+        g_assert(write(2, "\n", 1) == 1);
+    }
     json_message_parser_destroy(&qmp.parser);
 
     return qmp.response;