diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-04-20 18:23:56 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-04-20 18:23:56 +0200 |
commit | 0274b29916883efac50e0961c0a3b49ce8a11f1f (patch) | |
tree | 30f88847461ef58b90e7fe42cbdca8740dbc5cc7 /src/lib/hooklib.c | |
parent | 3572f658c5829492da1c99eae33b1e9ca9d4518c (diff) | |
download | abrt-0274b29916883efac50e0961c0a3b49ce8a11f1f.tar.gz abrt-0274b29916883efac50e0961c0a3b49ce8a11f1f.tar.xz abrt-0274b29916883efac50e0961c0a3b49ce8a11f1f.zip |
delete ugly parse_conf(), use load_abrt_conf() instead
Therefore moved abrt_conf.* to libreport
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/lib/hooklib.c')
-rw-r--r-- | src/lib/hooklib.c | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/src/lib/hooklib.c b/src/lib/hooklib.c index fd7ecc9a..3bde4dfa 100644 --- a/src/lib/hooklib.c +++ b/src/lib/hooklib.c @@ -19,78 +19,6 @@ #include "hooklib.h" #include <sys/statvfs.h> -void parse_conf(const char *additional_conf, unsigned *setting_MaxCrashReportsSize, bool *setting_MakeCompatCore, bool *setting_SaveBinaryImage) -{ - FILE *fp = fopen(CONF_DIR"/abrt.conf", "r"); - if (!fp) - return; - - while (1) - { - char *line = xmalloc_fgetline(fp); - if (!line) - { - fclose(fp); - if (additional_conf) - { - /* Next .conf file plz */ - fp = fopen(additional_conf, "r"); - if (fp) - { - additional_conf = NULL; - continue; - } - } - break; - } - - const char *p = skip_whitespace(line); -#undef DIRECTIVE -#define DIRECTIVE "MaxCrashReportsSize" - if (setting_MaxCrashReportsSize && strncmp(p, DIRECTIVE, sizeof(DIRECTIVE)-1) == 0) - { - p = skip_whitespace(p + sizeof(DIRECTIVE)-1); - if (*p != '=') - goto free_line; - p = skip_whitespace(p + 1); - if (isdigit(*p)) - { - /* x1.25: go a bit up, so that usual in-daemon trimming - * kicks in first, and we don't "fight" with it. */ - *setting_MaxCrashReportsSize = (unsigned long)xatou(p) * 5 / 4; - } - goto free_line; - } -#undef DIRECTIVE -#define DIRECTIVE "MakeCompatCore" - if (setting_MakeCompatCore && strncmp(p, DIRECTIVE, sizeof(DIRECTIVE)-1) == 0) - { - p = skip_whitespace(p + sizeof(DIRECTIVE)-1); - if (*p != '=') - goto free_line; - p = skip_whitespace(p + 1); - *setting_MakeCompatCore = string_to_bool(p); - goto free_line; - } -#undef DIRECTIVE -#define DIRECTIVE "SaveBinaryImage" - if (setting_SaveBinaryImage && strncmp(p, DIRECTIVE, sizeof(DIRECTIVE)-1) == 0) - { - p = skip_whitespace(p + sizeof(DIRECTIVE)-1); - if (*p != '=') - goto free_line; - p = skip_whitespace(p + 1); - *setting_SaveBinaryImage = string_to_bool(p); - goto free_line; - } -#undef DIRECTIVE - /* add more 'if (strncmp(p, DIRECTIVE, sizeof(DIRECTIVE)-1) == 0)' here... */ - - free_line: - free(line); - } -} - void check_free_space(unsigned setting_MaxCrashReportsSize) { struct statvfs vfs; |