diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-08-30 17:43:51 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-08-30 17:43:51 +0200 |
commit | 57217567c66fdc728387e7222b2044a1cd0d68a6 (patch) | |
tree | 6bc7977458af82161323c297a2d0396c86db49c1 /src | |
parent | f4b916d62e69bd2e6ff9690456a4a4557f449d24 (diff) | |
download | abrt-57217567c66fdc728387e7222b2044a1cd0d68a6.tar.gz abrt-57217567c66fdc728387e7222b2044a1cd0d68a6.tar.xz abrt-57217567c66fdc728387e7222b2044a1cd0d68a6.zip |
preparatory patch for dirsize.cpp -> dirsize.c conversion
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/daemon/Daemon.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/daemon/Daemon.cpp b/src/daemon/Daemon.cpp index 028c466c..ac845b1f 100644 --- a/src/daemon/Daemon.cpp +++ b/src/daemon/Daemon.cpp @@ -501,18 +501,19 @@ static gboolean handle_inotify_cb(GIOChannel *gio, GIOCondition condition, gpoin if (g_settings_nMaxCrashReportsSize > 0) { - std::string worst_dir; + char *worst_dir = NULL; while (g_settings_nMaxCrashReportsSize > 0 && get_dirsize_find_largest_dir(DEBUG_DUMPS_DIR, &worst_dir, name) / (1024*1024) >= g_settings_nMaxCrashReportsSize - && worst_dir != "" + && worst_dir ) { - log("Size of '%s' >= %u MB, deleting '%s'", DEBUG_DUMPS_DIR, g_settings_nMaxCrashReportsSize, worst_dir.c_str()); + log("Size of '%s' >= %u MB, deleting '%s'", DEBUG_DUMPS_DIR, g_settings_nMaxCrashReportsSize, worst_dir); g_pCommLayer->QuotaExceed(_("The size of the report exceeded the quota. Please check system's MaxCrashReportsSize value in abrt.conf.")); /* deletes both directory and DB record */ - char *d = concat_path_file(DEBUG_DUMPS_DIR, worst_dir.c_str()); + char *d = concat_path_file(DEBUG_DUMPS_DIR, worst_dir); + free(worst_dir); + worst_dir = NULL; DeleteDebugDump_by_dir(d); free(d); - worst_dir = ""; } } |