From a450e4924ad4ae4a05015e55cb54c78fb0c5015f Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 3 Oct 2011 14:24:03 +0200 Subject: [PATCH] client: fixup quit Signed-off-by: Jens Axboe --- client.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client.c b/client.c index cb229312..459c300b 100644 --- a/client.c +++ b/client.c @@ -309,6 +309,7 @@ static void handle_gs(struct fio_net_cmd *cmd) static int handle_client(struct fio_client *client) { struct fio_net_cmd *cmd; + int done = 0; while ((cmd = fio_net_recv_cmd(client->fd)) != NULL) { dprint(FD_NET, "%s: got cmd op %d\n", client->hostname, @@ -321,6 +322,7 @@ static int handle_client(struct fio_client *client) case FIO_NET_CMD_QUIT: remove_client(client); free(cmd); + done = 1; break; case FIO_NET_CMD_TEXT: fwrite(cmd->payload, cmd->pdu_len, 1, stdout); @@ -340,6 +342,9 @@ static int handle_client(struct fio_client *client) free(cmd); break; } + + if (done) + break; } return 0; -- 2.25.1