From bc0a375465dfd547e25b57c5caa4f3e00f622c36 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Sun, 14 Feb 2010 21:12:32 -0300 Subject: [PATCH] Logger: move specific values to header --- src/include/logfile.h | 3 +++ src/logfile.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/include/logfile.h b/src/include/logfile.h index 2034843..8a84433 100644 --- a/src/include/logfile.h +++ b/src/include/logfile.h @@ -26,6 +26,9 @@ #define S_LOG_ON 0 #define S_LOG_OFF 1 +#define MK_LOGFILE_PIPE_LIMIT 0.75 +#define MK_LOGFILE_TIMEOUT 3 + #define MK_LOGFILE_IOV_DASH " - " mk_pointer mk_logfile_iov_dash; diff --git a/src/logfile.c b/src/logfile.c index bea1d39..795f914 100644 --- a/src/logfile.c +++ b/src/logfile.c @@ -122,7 +122,7 @@ void *mk_logger_worker_init(void *args) /* Monkey allow just 75% of a pipe capacity */ pipe_size = sysconf(_SC_PAGESIZE) * 16; - buffer_limit = (pipe_size * 0.75); + buffer_limit = (pipe_size * MK_LOGFILE_PIPE_LIMIT); /* Creating poll */ efd = mk_epoll_create(max_events); @@ -142,7 +142,7 @@ void *mk_logger_worker_init(void *args) h = h->next; } - timeout = time(NULL) + 3; + timeout = time(NULL) + MK_LOGFILE_TIMEOUT; /* Reading pipe buffer */ while (1) { @@ -175,7 +175,7 @@ void *mk_logger_worker_init(void *args) break; } else { - timeout = clk + 3; + timeout = clk + MK_LOGFILE_TIMEOUT; flog = open(target->target, O_WRONLY | O_CREAT, 0644); if (flog == -1) { -- 2.11.4.GIT