+ return fd;
+}
+
+static int fio_client_connect_sock(struct fio_client *client)
+{
+ struct sockaddr_un *addr = &client->addr_un;
+ fio_socklen_t len;
+ int fd;
+
+ memset(addr, 0, sizeof(*addr));
+ addr->sun_family = AF_UNIX;
+ strcpy(addr->sun_path, client->hostname);
+
+ fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (fd < 0) {
+ log_err("fio: socket: %s\n", strerror(errno));
+ return -1;
+ }
+
+ len = sizeof(addr->sun_family) + strlen(addr->sun_path) + 1;
+ if (connect(fd, (struct sockaddr *) addr, len) < 0) {
+ log_err("fio: connect; %s\n", strerror(errno));
+ close(fd);
+ return -1;
+ }
+
+ return fd;
+}
+
+static int fio_client_connect(struct fio_client *client)
+{
+ int fd;
+
+ dprint(FD_NET, "client: connect to host %s\n", client->hostname);
+
+ if (client->is_sock)
+ fd = fio_client_connect_sock(client);
+ else
+ fd = fio_client_connect_ip(client);
+
+ if (fd < 0)
+ return 1;
+