diff options
author | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-05-05 16:46:48 +0200 |
---|---|---|
committer | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-05-05 16:46:48 +0200 |
commit | 31577ea88a5dbe0af40d6ee6980777cbdded80c6 (patch) | |
tree | d47fc7c3d678aba632b8dd90e5b54f598ae2f9b9 /src | |
parent | 04a316805eb2418f6a9d505a77e6021f26663966 (diff) | |
download | abrt-31577ea88a5dbe0af40d6ee6980777cbdded80c6.tar.gz abrt-31577ea88a5dbe0af40d6ee6980777cbdded80c6.tar.xz abrt-31577ea88a5dbe0af40d6ee6980777cbdded80c6.zip |
rid of rewriting config in /etc/abrt/abrt.conf
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/Daemon/Settings.cpp | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/Daemon/Settings.cpp b/src/Daemon/Settings.cpp index 99a5c8dc..4fe62762 100644 --- a/src/Daemon/Settings.cpp +++ b/src/Daemon/Settings.cpp @@ -464,38 +464,9 @@ static void SaveBool(const char* pKey, bool pBool, FILE* pFOut) fprintf(pFOut, "%s = %s\n", pKey, (pBool ? "yes" : "no")); } -/* Rewrite .conf file */ -void SaveSettings() -{ - FILE* fOut = fopen(CONF_DIR"/abrt.conf.NEW", "w"); - - if (fOut) - { - SaveSectionHeader(SECTION_COMMON, fOut); - SaveBool("OpenGPGCheck", g_settings_bOpenGPGCheck, fOut); - SaveSetString("OpenGPGPublicKeys", g_settings_setOpenGPGPublicKeys, fOut); - SaveSetString("BlackList", g_settings_mapBlackList, fOut); - fprintf(fOut, "Database = %s\n", g_settings_sDatabase.c_str()); - fprintf(fOut, "MaxCrashReportsSize = %u\n", g_settings_nMaxCrashReportsSize); - SaveVectorPairStrings("ActionsAndReporters", g_settings_vectorActionsAndReporters, fOut); - SaveSectionHeader(SECTION_ANALYZER_ACTIONS_AND_REPORTERS, fOut); - SaveMapVectorPairStrings(g_settings_mapAnalyzerActionsAndReporters, fOut); - SaveSectionHeader(SECTION_CRON, fOut); - SaveMapVectorPairStrings(g_settings_mapCron, fOut); - if (fclose(fOut) == 0 && rename(CONF_DIR"/abrt.conf.NEW", CONF_DIR"/abrt.conf") == 0) - { - return; /* success */ - } - } - perror_msg("Error saving '%s'", CONF_DIR"/abrt.conf"); - if (fOut) - unlink(CONF_DIR"/abrt.conf.NEW"); -} - /* dbus call to change some .conf file data */ void SetSettings(const map_abrt_settings_t& pSettings, const char *dbus_sender) { - bool dirty = false; int polkit_result; polkit_result = polkit_check_authorization(dbus_sender, @@ -513,14 +484,12 @@ void SetSettings(const map_abrt_settings_t& pSettings, const char *dbus_sender) { s_mapSectionCommon = it->second; ParseCommon(); - dirty = true; } it = pSettings.find(SECTION_ANALYZER_ACTIONS_AND_REPORTERS); if (it != end) { s_mapSectionAnalyzerActionsAndReporters = it->second; ParseAnalyzerActionsAndReporters(); - dirty = true; } it = pSettings.find(SECTION_CRON); if (it != end) @@ -529,8 +498,4 @@ void SetSettings(const map_abrt_settings_t& pSettings, const char *dbus_sender) ParseCron(); dirty = true; } - if (dirty) - { - SaveSettings(); - } } |