diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/libdlog/log.c | 3 | ||||
-rw-r--r-- | src/libdlog/loglimiter.c | 1 | ||||
-rw-r--r-- | src/logger/logger.c | 2 | ||||
-rwxr-xr-x | src/logutil/logutil.c | 5 | ||||
-rwxr-xr-x | src/shared/logprint.c | 10 |
5 files changed, 14 insertions, 7 deletions
diff --git a/src/libdlog/log.c b/src/libdlog/log.c index 46fa2d1..7ac948b 100755 --- a/src/libdlog/log.c +++ b/src/libdlog/log.c @@ -27,7 +27,10 @@ #include <unistd.h> #include <stdio.h> #include <errno.h> + +#include <dlog-internal.h> #include <dlog.h> + #include "loglimiter.h" #include "logconfig.h" #ifdef HAVE_SYSTEMD_JOURNAL diff --git a/src/libdlog/loglimiter.c b/src/libdlog/loglimiter.c index a0e874e..644c7ac 100644 --- a/src/libdlog/loglimiter.c +++ b/src/libdlog/loglimiter.c @@ -31,6 +31,7 @@ #include <time.h> /* Included for priorities level */ +#include <dlog-internal.h> #include <dlog.h> #include "loglimiter.h" diff --git a/src/logger/logger.c b/src/logger/logger.c index 6b3a5cf..249dc60 100644 --- a/src/logger/logger.c +++ b/src/logger/logger.c @@ -45,7 +45,7 @@ #define COMMAND_MAX 5 #define DELIMITER " " -#define FILE_PERMS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH) +#define FILE_PERMS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP) #define MAX_ARGS 16 #define MAX_ROTATED 4 #define MAX_QUEUED 4096 diff --git a/src/logutil/logutil.c b/src/logutil/logutil.c index ea96cfb..2fcd8ff 100755 --- a/src/logutil/logutil.c +++ b/src/logutil/logutil.c @@ -286,7 +286,6 @@ static void read_log_lines(struct log_device_t* devices) exit(EXIT_FAILURE); } - entry->entry.msg[entry->entry.len] = '\0'; enqueue(dev, entry); @@ -737,7 +736,7 @@ int main(int argc, char **argv) } } - if (getLogSize) { + if (getLogSize || g_nonblock) { int size, readable; size = get_log_size(dev->fd); @@ -751,7 +750,7 @@ int main(int argc, char **argv) perror("ioctl"); exit(EXIT_FAILURE); } - + g_log_rotate_size_kbytes += size / 1024; printf("%s: ring buffer is %dKb (%dKb consumed), " "max entry is %db, max payload is %db\n", dev->device, size / 1024, readable / 1024, diff --git a/src/shared/logprint.c b/src/shared/logprint.c index 6ab4d72..e58a661 100755 --- a/src/shared/logprint.c +++ b/src/shared/logprint.c @@ -287,14 +287,18 @@ int log_add_filter_rule(log_format *p_format, pri = DLOG_VERBOSE; } - char *tagName; + char *tagName = NULL; tagName = strndup(filterExpression, tagNameLength); + if (!tagName) { + goto error; + } FilterInfo *p_fi = filterinfo_new(tagName, pri); free(tagName); - if (!p_fi) - goto error; + if (!p_fi) { + goto error; + } p_fi->p_next = p_format->filters; p_format->filters = p_fi; } |