gfio: remove warning on g_type_init() being deprecated
[fio.git] / client.c
index 6e7ed6d58441819d0df6359876d880a9a17d3b1e..1dded0966cf9bcba261fb1fe5282d20bc3b67c94 100644 (file)
--- a/client.c
+++ b/client.c
@@ -823,9 +823,11 @@ static void convert_gs(struct group_run_stats *dst, struct group_run_stats *src)
 }
 
 static void json_object_add_client_info(struct json_object *obj,
-struct fio_client *client)
+                                       struct fio_client *client)
 {
-       json_object_add_value_string(obj, "hostname", client->hostname);
+       const char *hostname = client->hostname ? client->hostname : "";
+
+       json_object_add_value_string(obj, "hostname", hostname);
        json_object_add_value_int(obj, "port", client->port);
 }
 
@@ -1232,15 +1234,15 @@ static struct cmd_iolog_pdu *convert_iolog(struct fio_net_cmd *cmd)
        ret->compressed         = le32_to_cpu(ret->compressed);
        ret->log_offset         = le32_to_cpu(ret->log_offset);
 
-       samples = &ret->samples[i];
+       samples = &ret->samples[0];
        for (i = 0; i < ret->nr_samples; i++) {
                struct io_sample *s;
 
                s = __get_sample(samples, ret->log_offset, i);
-               s->time = le64_to_cpu(s->time);
-               s->val  = le64_to_cpu(s->val);
-               s->ddir = le32_to_cpu(s->ddir);
-               s->bs   = le32_to_cpu(s->bs);
+               s->time         = le64_to_cpu(s->time);
+               s->val          = le64_to_cpu(s->val);
+               s->__ddir       = le32_to_cpu(s->__ddir);
+               s->bs           = le32_to_cpu(s->bs);
 
                if (ret->log_offset) {
                        struct io_sample_offset *so = (void *) s;