diff options
| author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-05-04 14:39:37 +0200 |
|---|---|---|
| committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-05-04 14:39:37 +0200 |
| commit | 58e7efce3d5ac71e308e7e44176473cd66e8ad26 (patch) | |
| tree | d4822587940487f2910e925990a55377e60e05bd /src/plugins/abrt-dump-oops.c | |
| parent | 27e7d86db7c6c96e8da75e8e8dda6359b9e73c41 (diff) | |
| download | abrt-58e7efce3d5ac71e308e7e44176473cd66e8ad26.tar.gz abrt-58e7efce3d5ac71e308e7e44176473cd66e8ad26.tar.xz abrt-58e7efce3d5ac71e308e7e44176473cd66e8ad26.zip | |
move $ABRT_foo checking and setting into helper routines.
I'm sick of fixing incorrect PROGNAME defines.
Now g_progname is a variable and it is set from argv[0].
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/plugins/abrt-dump-oops.c')
| -rw-r--r-- | src/plugins/abrt-dump-oops.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/plugins/abrt-dump-oops.c b/src/plugins/abrt-dump-oops.c index f716c3db..c2879caa 100644 --- a/src/plugins/abrt-dump-oops.c +++ b/src/plugins/abrt-dump-oops.c @@ -23,8 +23,6 @@ #include "abrtlib.h" #include "parse_options.h" -#define PROGNAME "abrt-dump-oops" - static bool world_readable_dump = false; static const char *debug_dumps_dir = "."; @@ -560,13 +558,11 @@ static unsigned save_oops_to_dump_dir(GList *oops_list, unsigned oops_cnt) int main(int argc, char **argv) { - char *env_verbose = getenv("ABRT_VERBOSE"); - if (env_verbose) - g_verbose = atoi(env_verbose); + abrt_init(argv); /* Can't keep these strings/structs static: _() doesn't support that */ const char *program_usage_string = _( - PROGNAME" [-vsrowx] [-d DIR] FILE\n" + "\b [-vsrowx] [-d DIR] FILE\n" "\n" "Extract oops from syslog/dmesg file" ); @@ -595,11 +591,11 @@ int main(int argc, char **argv) }; unsigned opts = parse_opts(argc, argv, program_options, program_usage_string); - putenv(xasprintf("ABRT_VERBOSE=%u", g_verbose)); - msg_prefix = PROGNAME; - if ((opts & OPT_s) - || getenv("ABRT_SYSLOG") - ) { + export_abrt_envvars(0); + + msg_prefix = g_progname; + if ((opts & OPT_s) || getenv("ABRT_SYSLOG")) + { openlog(msg_prefix, 0, LOG_DAEMON); logmode = LOGMODE_SYSLOG; } |
