From 57217567c66fdc728387e7222b2044a1cd0d68a6 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 30 Aug 2010 17:43:51 +0200 Subject: preparatory patch for dirsize.cpp -> dirsize.c conversion Signed-off-by: Denys Vlasenko --- src/daemon/Daemon.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/daemon/Daemon.cpp') 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 = ""; } } -- cgit