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/daemon/abrt-handle-crashdump.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/daemon/abrt-handle-crashdump.c')
-rw-r--r-- | src/daemon/abrt-handle-crashdump.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/daemon/abrt-handle-crashdump.c b/src/daemon/abrt-handle-crashdump.c index 3c3e433f..d04e4fef 100644 --- a/src/daemon/abrt-handle-crashdump.c +++ b/src/daemon/abrt-handle-crashdump.c @@ -19,8 +19,6 @@ #include "abrtlib.h" #include "parse_options.h" -#define PROGNAME "abrt-handle-crashdump" - static const char *dump_dir_name = NULL; //static const char *conf_filename = CONF_DIR"/abrt_event.conf"; static const char *event; @@ -34,14 +32,12 @@ static char *do_log(char *log_line, void *param) 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" [-vs]" /*" [-c CONFFILE]"*/ " -d DIR -e EVENT\n" - " or: "PROGNAME" [-vs]" /*" [-c CONFFILE]"*/ " [-d DIR] -l[PFX]\n" + "\b [-vs]" /*" [-c CONFFILE]"*/ " -d DIR -e EVENT\n" + " or: \b [-vs]" /*" [-c CONFFILE]"*/ " [-d DIR] -l[PFX]\n" "\n" "Handles dump directory DIR according to rules in abrt_event.conf" ); @@ -69,10 +65,8 @@ int main(int argc, char **argv) if (!(opts & (OPT_e|OPT_l))) show_usage_and_die(program_usage_string, program_options); - putenv(xasprintf("ABRT_VERBOSE=%u", g_verbose)); - msg_prefix = PROGNAME; - if (opts & OPT_p) - putenv((char*)"ABRT_PROG_PREFIX=1"); + export_abrt_envvars(opts & OPT_p); + if (opts & OPT_s) { openlog(msg_prefix, 0, LOG_DAEMON); |