log: use __log_buf() if we know buf != NULL
[fio.git] / client.c
index 31c7c6495790e91018cface694803ff9bfcefa1e..0f28cf6373535959f933c0ab8eddb8c495f256bc 100644 (file)
--- a/client.c
+++ b/client.c
@@ -1144,13 +1144,16 @@ static void handle_text(struct fio_client *client, struct fio_net_cmd *cmd)
        const char *buf = (const char *) pdu->buf;
        const char *name;
        int fio_unused ret;
+       struct buf_output out;
+
+       buf_output_init(&out);
 
        name = client->name ? client->name : client->hostname;
 
        if (!client->skip_newline && !(output_format & FIO_OUTPUT_TERSE))
-               fprintf(f_out, "<%s> ", name);
-       ret = fwrite(buf, pdu->buf_len, 1, f_out);
-       fflush(f_out);
+               __log_buf(&out, "<%s> ", name);
+       __log_buf(&out, "%s", buf);
+       log_info_buf(out.buf, out.buflen);
        client->skip_newline = strchr(buf, '\n') == NULL;
 }