From 82fa6b21d98da1341a54f415e43940213b39f18b Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 30 Sep 2011 22:29:08 -0600 Subject: [PATCH] server: debug fixes Signed-off-by: Jens Axboe --- server.c | 5 +++-- server.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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); -- 2.25.1