Blob Blame Raw
From ebf1fc2fc34a182fbe0cb4a99d4a07f1e72925dd Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Tue, 26 Aug 2014 23:57:46 +0200
Subject: [PATCH] a-h-event: don't spam system logs

Don't print messages about invalid dump directories so many times.
Every dump directory has at leas 4 post-create events and after end of
each of these events abrt-handle-event tries to find duplicates. It
means 4x opens every dump directory, so it prints 4 lines for a single
invalid dump directory.

This patch dissables the error messages in the default log mode.

Related to rhbz#1133674

Signed-off-by: Jakub Filak <jfilak@redhat.com>
---
 src/daemon/abrt-handle-event.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/daemon/abrt-handle-event.c b/src/daemon/abrt-handle-event.c
index 7100171..a65f86e 100644
--- a/src/daemon/abrt-handle-event.c
+++ b/src/daemon/abrt-handle-event.c
@@ -282,7 +282,11 @@ static int is_crash_a_dup(const char *dump_dir_name, void *param)
         if (strcmp(dump_dir_name, dump_dir_name2) == 0)
             goto next; /* we are never a dup of ourself */
 
+        int sv_logmode = logmode;
+        /* Silently ignore any error in the silent log level. */
+        logmode = g_verbose == 0 ? 0 : sv_logmode;
         dd = dd_opendir(dump_dir_name2, /*flags:*/ DD_FAIL_QUIETLY_ENOENT | DD_OPEN_READONLY);
+        logmode = sv_logmode;
         if (!dd)
             goto next;
 
-- 
1.9.3