server: use passed in sk in send functions
authorJens Axboe <axboe@kernel.dk>
Tue, 20 Mar 2012 13:35:35 +0000 (14:35 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 20 Mar 2012 13:35:35 +0000 (14:35 +0100)
It's not always server_fd, for client communication it's the
client fd.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
server.c

index d5733c4e05901a4f720e07e217320486d24e4138..5e0d322baeae1c8c4664f57f68ec9cbb23ff6d59 100644 (file)
--- a/server.c
+++ b/server.c
@@ -392,7 +392,7 @@ int fio_net_send_quit(int sk)
 {
        dprint(FD_NET, "server: sending quit\n");
 
 {
        dprint(FD_NET, "server: sending quit\n");
 
-       return fio_net_send_simple_cmd(server_fd, FIO_NET_CMD_QUIT, 0, NULL);
+       return fio_net_send_simple_cmd(sk, FIO_NET_CMD_QUIT, 0, NULL);
 }
 
 int fio_net_send_stop(int sk, int error, int signal)
 }
 
 int fio_net_send_stop(int sk, int error, int signal)
@@ -403,7 +403,7 @@ int fio_net_send_stop(int sk, int error, int signal)
 
        epdu.error = __cpu_to_le32(error);
        epdu.signal = __cpu_to_le32(signal);
 
        epdu.error = __cpu_to_le32(error);
        epdu.signal = __cpu_to_le32(signal);
-       return fio_net_send_cmd(server_fd, FIO_NET_CMD_STOP, &epdu, sizeof(epdu), 0);
+       return fio_net_send_cmd(sk, FIO_NET_CMD_STOP, &epdu, sizeof(epdu), 0);
 }
 
 static void fio_server_add_fork_item(pid_t pid, struct flist_head *list)
 }
 
 static void fio_server_add_fork_item(pid_t pid, struct flist_head *list)
@@ -1016,7 +1016,7 @@ static int fio_send_cmd_ext_pdu(int sk, uint16_t opcode, const void *buf,
        cmd.flags = __cpu_to_le32(flags);
        fio_net_cmd_crc_pdu(&cmd, buf);
 
        cmd.flags = __cpu_to_le32(flags);
        fio_net_cmd_crc_pdu(&cmd, buf);
 
-       return fio_sendv_data(server_fd, iov, 2);
+       return fio_sendv_data(sk, iov, 2);
 }
 
 int fio_send_iolog(struct thread_data *td, struct io_log *log, const char *name)
 }
 
 int fio_send_iolog(struct thread_data *td, struct io_log *log, const char *name)