diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-05-02 19:23:51 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-05-02 19:23:51 +0200 |
commit | 83514402882c80fe6bc7ac989ca78ad3cb122464 (patch) | |
tree | 22235e6c2f5d7ebf7acb4d1255e62d390f7f71e2 | |
parent | 67a3602e83af42f932e0583d7385d9bcf7ea7e16 (diff) | |
download | abrt-83514402882c80fe6bc7ac989ca78ad3cb122464.tar.gz abrt-83514402882c80fe6bc7ac989ca78ad3cb122464.tar.xz abrt-83514402882c80fe6bc7ac989ca78ad3cb122464.zip |
fix for spurious "Lock file 'DIR/.lock' is locked by process PID" message
Message was caused by concurrent access by abrt-gui (refreshing the list)
and wizard (running events).
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r-- | src/gui-gtk/abrt-gtk.c | 7 | ||||
-rw-r--r-- | src/gui-gtk/main.c | 3 | ||||
-rw-r--r-- | src/gui-wizard-gtk/wizard.c | 6 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/gui-gtk/abrt-gtk.c b/src/gui-gtk/abrt-gtk.c index dc5aa5aa..61c5c4f9 100644 --- a/src/gui-gtk/abrt-gtk.c +++ b/src/gui-gtk/abrt-gtk.c @@ -44,7 +44,14 @@ enum void add_directory_to_dirlist(const char *dirname) { + /* Silently ignore *any* errors, not only EACCES. + * We saw "lock file is locked by process PID" error + * when we raced with wizard. + */ + int sv_logmode = logmode; + logmode = 0; struct dump_dir *dd = dd_opendir(dirname, DD_OPEN_READONLY | DD_FAIL_QUIETLY_EACCES); + logmode = sv_logmode; if (!dd) return; diff --git a/src/gui-gtk/main.c b/src/gui-gtk/main.c index ec2904b1..0c1bc644 100644 --- a/src/gui-gtk/main.c +++ b/src/gui-gtk/main.c @@ -219,6 +219,9 @@ int main(int argc, char **argv) unsigned opts = parse_opts(argc, argv, program_options, program_usage_string); putenv(xasprintf("ABRT_VERBOSE=%u", g_verbose)); + char *pfx = getenv("ABRT_PROG_PREFIX"); + if (pfx && string_to_bool(pfx)) + msg_prefix = PROGNAME; if (opts & OPT_p) { msg_prefix = PROGNAME; diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c index ee6c3c39..6e3bec69 100644 --- a/src/gui-wizard-gtk/wizard.c +++ b/src/gui-wizard-gtk/wizard.c @@ -829,9 +829,6 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g } } - /* Inform abrt-gui that it is a good idea to rescan the directory */ - kill(getppid(), SIGCHLD); - /* Stop if exit code is not 0, or no more commands */ if (retval != 0 || spawn_next_command_in_evd(evd) < 0 @@ -839,6 +836,9 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g VERB1 log("done running event on '%s': %d", g_dump_dir_name, retval); //append_to_textview(evd->tv_log, msg); + /* Inform abrt-gui that it is a good idea to rescan the directory */ + kill(getppid(), SIGCHLD); + for (;;) { if (!evd->more_events) |