From: Jens Axboe Date: Sat, 1 Oct 2011 04:29:08 +0000 (-0600) Subject: server: debug fixes X-Git-Tag: fio-1.99~81 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=82fa6b21d98da1341a54f415e43940213b39f18b;p=fio.git server: debug fixes Signed-off-by: Jens Axboe --- diff --git a/server.c b/server.c index 8bbac70f..79c10410 100644 --- a/server.c +++ b/server.c @@ -385,10 +385,11 @@ int fio_server_log(const char *format, ...) { char buffer[1024]; va_list args; + size_t len; va_start(args, format); - snprintf(buffer, sizeof(buffer), format, args); + len = vsnprintf(buffer, sizeof(buffer), format, args); va_end(args); - return fio_server_text_output(buffer, strlen(buffer)); + return fio_server_text_output(buffer, len); } diff --git a/server.h b/server.h index 79449a63..d66782d5 100644 --- a/server.h +++ b/server.h @@ -74,7 +74,7 @@ static inline void fio_init_net_cmd(struct fio_net_cmd *cmd, uint16_t opcode, memset(cmd, 0, sizeof(*cmd)); cmd->version = cpu_to_le16(FIO_SERVER_VER1); - cmd->opcode = cpu_to_le16(FIO_NET_CMD_TEXT); + cmd->opcode = cpu_to_le16(opcode); if (pdu) { cmd->pdu_len = cpu_to_le32(pdu_len);