client: don't clear client->addr after it's been set
[fio.git] / client.c
index 11ad1fe7f4c3ee84fb60967f2afe180072217857..9caefbb86a6a8d48debbe369de310a832a847185 100644 (file)
--- a/client.c
+++ b/client.c
@@ -176,7 +176,8 @@ static int fio_client_connect_ip(struct fio_client *client)
 
        if (connect(fd, (struct sockaddr *) &client->addr, sizeof(client->addr)) < 0) {
                log_err("fio: connect: %s\n", strerror(errno));
-               log_err("fio: failed to connect to %s\n", client->hostname);
+               log_err("fio: failed to connect to %s:%u\n", client->hostname,
+                                                               client->port);
                close(fd);
                return -1;
        }
@@ -216,8 +217,6 @@ static int fio_client_connect(struct fio_client *client)
 
        dprint(FD_NET, "client: connect to host %s\n", client->hostname);
 
-       memset(&client->addr, 0, sizeof(client->addr));
-
        if (client->is_sock)
                fd = fio_client_connect_sock(client);
        else
@@ -532,9 +531,18 @@ static void handle_eta(struct fio_net_cmd *cmd)
 static void handle_probe(struct fio_net_cmd *cmd)
 {
        struct cmd_probe_pdu *probe = (struct cmd_probe_pdu *) cmd->payload;
+       const char *os, *arch;
+
+       os = fio_get_os_string(probe->os);
+       if (!os)
+               os = "unknown";
+
+       arch = fio_get_arch_string(probe->arch);
+       if (!arch)
+               os = "unknown";
 
-       log_info("Probe: hostname=%s, be=%u, fio ver %u.%u.%u\n",
-               probe->hostname, probe->bigendian, probe->fio_major,
+       log_info("hostname=%s, be=%u, os=%s, arch=%s, fio ver %u.%u.%u\n",
+               probe->hostname, probe->bigendian, os, arch, probe->fio_major,
                probe->fio_minor, probe->fio_patch);
 }