diff options
-rw-r--r-- | src/Daemon/Daemon.cpp | 23 | ||||
-rw-r--r-- | src/Daemon/abrt.conf | 2 |
2 files changed, 14 insertions, 11 deletions
diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 02b8b96e..3ba8d4d2 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -506,16 +506,19 @@ static gboolean handle_inotify_cb(GIOChannel *gio, GIOCondition condition, gpoin } log("Directory '%s' creation detected", name); - std::string worst_dir; - while (g_settings_nMaxCrashReportsSize > 0 - && get_dirsize_find_largest_dir(DEBUG_DUMPS_DIR, &worst_dir, name) / (1024*1024) >= g_settings_nMaxCrashReportsSize - && worst_dir != "" - ) { - log("Size of '%s' >= %u MB, deleting '%s'", DEBUG_DUMPS_DIR, g_settings_nMaxCrashReportsSize, worst_dir.c_str()); - g_pCommLayer->QuotaExceed(_("Report size exceeded the quota. Please check system's MaxCrashReportsSize value in abrt.conf.")); - /* deletes both directory and DB record */ - DeleteDebugDump_by_dir(concat_path_file(DEBUG_DUMPS_DIR, worst_dir.c_str()).c_str()); - worst_dir = ""; + if (g_settings_nMaxCrashReportsSize > 0) + { + std::string worst_dir; + while (g_settings_nMaxCrashReportsSize > 0 + && get_dirsize_find_largest_dir(DEBUG_DUMPS_DIR, &worst_dir, name) / (1024*1024) >= g_settings_nMaxCrashReportsSize + && worst_dir != "" + ) { + log("Size of '%s' >= %u MB, deleting '%s'", DEBUG_DUMPS_DIR, g_settings_nMaxCrashReportsSize, worst_dir.c_str()); + g_pCommLayer->QuotaExceed(_("Report size exceeded the quota. Please check system's MaxCrashReportsSize value in abrt.conf.")); + /* deletes both directory and DB record */ + DeleteDebugDump_by_dir(concat_path_file(DEBUG_DUMPS_DIR, worst_dir.c_str()).c_str()); + worst_dir = ""; + } } try diff --git a/src/Daemon/abrt.conf b/src/Daemon/abrt.conf index b88b6b96..534aef8f 100644 --- a/src/Daemon/abrt.conf +++ b/src/Daemon/abrt.conf @@ -29,7 +29,7 @@ Database = SQLite3 # #WatchCrashdumpArchiveDir = /var/spool/abrt-upload -# Max size for crash storage [MiB] +# Max size for crash storage [MiB] or 0 for unlimited # MaxCrashReportsSize = 1000 |