diff --git a/core/logging.c b/core/logging.c index 73f86551..3a0b8f37 100644 --- a/core/logging.c +++ b/core/logging.c @@ -498,7 +498,7 @@ void uwsgi_check_logrotate(void) { uwsgi.shared->logsize = lseek(2, 0, SEEK_CUR); } - if (uwsgi.log_maxsize > 0 && uwsgi.shared->logsize > uwsgi.log_maxsize) { + if (uwsgi.log_maxsize > 0 && (uint64_t) uwsgi.shared->logsize > uwsgi.log_maxsize) { need_rotation = 1; } diff --git a/core/uwsgi.c b/core/uwsgi.c index 4125b624..47b831ca 100644 --- a/core/uwsgi.c +++ b/core/uwsgi.c @@ -641,7 +641,7 @@ static struct uwsgi_option uwsgi_base_options[] = { {"log-master-req-stream", no_argument, 0, "create the master requests logpipe as SOCK_STREAM", uwsgi_opt_true, &uwsgi.log_master_req_stream, 0}, {"log-reopen", no_argument, 0, "reopen log after reload", uwsgi_opt_true, &uwsgi.log_reopen, 0}, {"log-truncate", no_argument, 0, "truncate log on startup", uwsgi_opt_true, &uwsgi.log_truncate, 0}, - {"log-maxsize", required_argument, 0, "set maximum logfile size", uwsgi_opt_set_int, &uwsgi.log_maxsize, UWSGI_OPT_LOG_MASTER}, + {"log-maxsize", required_argument, 0, "set maximum logfile size", uwsgi_opt_set_64bit, &uwsgi.log_maxsize, UWSGI_OPT_LOG_MASTER}, {"log-backupname", required_argument, 0, "set logfile name after rotation", uwsgi_opt_set_str, &uwsgi.log_backupname, 0}, {"logdate", optional_argument, 0, "prefix logs with date or a strftime string", uwsgi_opt_log_date, NULL, 0}, diff --git a/uwsgi.h b/uwsgi.h index 3c684c33..1516ab79 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -1974,7 +1974,7 @@ struct uwsgi_server { int log_reopen; int log_truncate; - off_t log_maxsize; + uint64_t log_maxsize; char *log_backupname; int original_log_fd;