summary_write_cache(mainwin->summaryview);
main_window_lock(mainwin);
- if (prefs_common.use_extinc && prefs_common.extinc_path) {
- gint pid;
-
+ if (prefs_common.use_extinc && prefs_common.extinc_cmd) {
/* external incorporating program */
- if ((pid = fork()) < 0) {
- perror("fork");
+ if (execute_command_line(prefs_common.extinc_cmd, FALSE) < 0) {
main_window_unlock(mainwin);
inc_autocheck_timer_set();
return;
}
- if (pid == 0) {
- execlp(prefs_common.extinc_path,
- g_basename(prefs_common.extinc_path),
- NULL);
-
- /* this will be called when failed */
- perror("exec");
- _exit(1);
- }
-
- /* wait until child process is terminated */
- waitpid(pid, NULL, 0);
-
if (prefs_common.inc_local)
new_msgs = inc_spool();
} else {
GTK_SIGNAL_FUNC(inc_cancel), dialog);
gtk_signal_connect(GTK_OBJECT(progress->window), "delete_event",
GTK_SIGNAL_FUNC(gtk_true), NULL);
+ /* manage_window_set_transient(GTK_WINDOW(progress->window)); */
progress_dialog_set_value(progress, 0.0);
automaton_input_cb, atm);
#endif
- gtk_main();
+ while (!atm->terminated)
+ gtk_main_iteration();
log_verbosity_set(FALSE);
recv_set_ui_func(NULL, NULL);
static gint pop3_automaton_terminate(SockInfo *source, Automaton *atm)
{
+ if (atm->terminated) return 0;
+
if (atm->tag > 0) {
gdk_input_remove(atm->tag);
atm->tag = 0;
gtk_timeout_remove(atm->timeout_tag);
atm->timeout_tag = 0;
}
- if (source) {
+ if (source)
sock_close(source);
- gtk_main_quit();
- }
atm->terminated = TRUE;
manage_window_focus_out(inc_dialog->dialog->window, NULL, NULL);
}
pop3_automaton_terminate(sockinfo, atm);
+ state->sockinfo = NULL;
return FALSE;
} else if (sockinfo->state == CONN_ESTABLISHED) {
atm->timeout_tag = 0;
IncSession *session = dialog->queue_list->data;
SockInfo *sockinfo = session->pop3_state->sockinfo;
+ if (!sockinfo || session->atm->terminated == TRUE) return;
+
#if USE_THREADS
if (sockinfo->state == CONN_READY ||
sockinfo->state == CONN_LOOKUPSUCCESS) {
session->pop3_state->inc_state = INC_CANCEL;
pop3_automaton_terminate(sockinfo, session->atm);
+ session->pop3_state->sockinfo = NULL;
}
static gint inc_spool(void)