From b57816c4a72379f967310691984856ecfb555f79 Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Mon, 26 Oct 2015 11:20:13 +0100 Subject: [PATCH 1/3] mxq_log: Use mx_streq() --- mxq_log.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mxq_log.c b/mxq_log.c index d59ffac..77b40b5 100644 --- a/mxq_log.c +++ b/mxq_log.c @@ -8,6 +8,8 @@ #include #include "mx_log.h" +#include "mx_util.h" + #ifndef mx_free_null #include #define mx_free_null(a) do { free((a)); (a) = NULL; } while(0) @@ -42,7 +44,6 @@ static int timetag(char *buf, size_t size) int mx_log_print(char *msg, size_t len) { - int res; char timebuf[1024]; static char *lastmsg = NULL; @@ -61,8 +62,7 @@ int mx_log_print(char *msg, size_t len) return -(errno=EINVAL); if (lastmsg && lastlen == len) { - res = strcmp(msg, lastmsg); - if (res == 0) { + if (mx_streq(msg, lastmsg)) { cnt++; mx_free_null(msg); return 2; From 379116434fe9c9e4f98167d064f7e029741b7e50 Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Mon, 26 Oct 2015 11:40:40 +0100 Subject: [PATCH 2/3] mx_log: Fix typo "ALERT" --- mx_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mx_log.c b/mx_log.c index ba5a8d5..6a6a5b5 100644 --- a/mx_log.c +++ b/mx_log.c @@ -109,7 +109,7 @@ static int log_log(int level, int loglevel, char *file, unsigned long line, cons prefix = "EMERGENCY: "; break; case MX_LOG_ALERT: - prefix = "AKERT: "; + prefix = "ALERT: "; break; case MX_LOG_CRIT: prefix = "CRITCAL ERROR: "; From e345231577705b9fc94a6c4e39a292bd7fa1b329 Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Mon, 26 Oct 2015 13:54:18 +0100 Subject: [PATCH 3/3] Makefile: Build and run tests by default --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a9f5846..b6b0e80 100644 --- a/Makefile +++ b/Makefile @@ -186,7 +186,7 @@ manpages/%: manpages/%.xml .PHONY: all .PHONY: build -all: build +all: build test .PHONY: devel devel: CFLAGS += -DMXQ_DEVELOPMENT