From 73f4f9e8ca3f177a2737c77110696a81e5f831b0 Mon Sep 17 00:00:00 2001 From: Dmitry Simonenko Date: Sun, 10 Feb 2019 14:27:28 +0300 Subject: [PATCH] odyssey: fix warnings --- sources/logger.c | 6 ++++-- sources/readahead.h | 4 ++-- third_party/machinarium/sources/machinarium_private.h | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sources/logger.c b/sources/logger.c index c6b5991c..b1802042 100644 --- a/sources/logger.c +++ b/sources/logger.c @@ -379,13 +379,15 @@ od_logger_write(od_logger_t *logger, od_logger_level_t level, int len; len = od_logger_format(logger, level, context, client, server, fmt, args, output, sizeof(output)); + int rc; if (logger->fd != -1) { - (void)write(logger->fd, output, len); + rc = write(logger->fd, output, len); } if (logger->log_stdout) { - (void)write(STDOUT_FILENO, output, len); + rc = write(STDOUT_FILENO, output, len); } if (logger->log_syslog) { syslog(od_log_syslog_level[level], "%.*s", len, output); } + (void)rc; } diff --git a/sources/readahead.h b/sources/readahead.h index 4ea22a81..7b8ec016 100644 --- a/sources/readahead.h +++ b/sources/readahead.h @@ -83,8 +83,8 @@ od_readahead_pos_read_advance(od_readahead_t *readahead, int value) static inline void od_readahead_reuse(od_readahead_t *readahead) { - int unread = od_readahead_unread(readahead); - if (unread > (int)sizeof(sizeof(kiwi_header_t))) + size_t unread = od_readahead_unread(readahead); + if (unread > sizeof(sizeof(kiwi_header_t))) return; if (unread == 0) { readahead->pos = 0; diff --git a/third_party/machinarium/sources/machinarium_private.h b/third_party/machinarium/sources/machinarium_private.h index 8bcff988..b0292a53 100644 --- a/third_party/machinarium/sources/machinarium_private.h +++ b/third_party/machinarium/sources/machinarium_private.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include