* src/procmsg.c
authorChristoph Hohmann <reboot@gmx.ch>
Thu, 14 Mar 2002 11:38:12 +0000 (11:38 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Thu, 14 Mar 2002 11:38:12 +0000 (11:38 +0000)
* src/send.c
        fix local delivery
        (patch submitted by "Simon 'corecode' Schubert")
* src/prefs_common.c
* src/procmsg.c
        fix gcc 3.0 warning

ChangeLog.claws
configure.in
src/prefs_common.c
src/procmsg.c
src/send.c

index f93b5950fb9598980525e430eb066cf10732e4be..e278b7a4a8104e9262e6a9e1b32f7b4e16a4e9f1 100644 (file)
@@ -1,3 +1,13 @@
+2002-03-14 [christoph] 0.7.4claws3
+
+       * src/procmsg.c
+       * src/send.c
+               fix local delivery
+               (patch submitted by "Simon 'corecode' Schubert")
+       * src/prefs_common.c
+       * src/procmsg.c
+               fix gcc 3.0 warning
+
 2002-03-14 [paul]      0.7.4claws2
 
        * sync with sylpheed 0.7.4cvs2
index d5dbb51206af07d4cfdb42c364f910d475577e5e..4c49486db0c2c8f60d184c163e88cb8062f0e196 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=4
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws2
+EXTRA_VERSION=claws3
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 0dd45cc0f0178241eebce0c76a4109559a8b0acc..d07fb134d564ae1032d81fe161c4180a26031285 100644 (file)
@@ -3973,7 +3973,6 @@ static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam)
        case NEXTUNREADMSGDIALOG_ASSUME_NO:
                gtk_option_menu_set_history(optmenu, 2);
                break;
-       default:
        }
 
        menu = gtk_option_menu_get_menu(optmenu);
index 4f69ba61b28cae1f1688f9fc5db541a013a5b6c4..d7f5e89643c05b260a32fefe6bde3debb0d35c9b 100644 (file)
@@ -1045,6 +1045,7 @@ gint procmsg_send_message_queue(const gchar *file)
        gint hnum;
        PrefsAccount *mailac = NULL, *newsac = NULL;
        gchar *tmp = NULL;
+       int local = 0;
 
        g_return_val_if_fail(file != NULL, -1);
 
@@ -1079,7 +1080,6 @@ gint procmsg_send_message_queue(const gchar *file)
                case Q_SAVE_COPY_FOLDER:
                        if (!savecopyfolder) savecopyfolder = g_strdup(p);
                        break;
-               default:
                }
        }
        filepos = ftell(fp);
@@ -1117,8 +1117,10 @@ gint procmsg_send_message_queue(const gchar *file)
                } else if (mailac && mailac->use_mail_command &&
                           mailac->mail_command && (* mailac->mail_command)) {
                        mailval = send_message_local(mailac->mail_command, fp);
+                       local = 1;
                } else if (prefs_common.use_extsend && prefs_common.extsend_cmd) {
                        mailval = send_message_local(prefs_common.extsend_cmd, fp);
+                       local = 1;
                } else {
                        if (!mailac) {
                                mailac = account_find_from_smtp_server(from, smtpserver);
@@ -1144,8 +1146,16 @@ gint procmsg_send_message_queue(const gchar *file)
                        }
                }
                if (mailval < 0) {
-                       alertpanel_error(_("Error occurred while sending the message to %s ."),
-                                 mailac ? mailac->smtp_server : smtpserver);
+                       if (!local)
+                               alertpanel_error(
+                                       _("Error occurred while sending the message to `%s'."),
+                                       mailac ? mailac->smtp_server : smtpserver);
+                       else
+                               alertpanel_error(
+                                       _("Error occurred while sending the message with command `%s'."),
+                                       (mailac && mailac->use_mail_command && 
+                                        mailac->mail_command && (*mailac->mail_command)) ? 
+                                               mailac->mail_command : prefs_common.extsend_cmd);
                }
        }
 
index 4ae48d083156789e4e9e45174ec4b0cef3a481e4..645be80bacb6b920a1d854551887d25ee6f0852f 100644 (file)
@@ -31,6 +31,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <sys/time.h>
+#include <signal.h>
 #include <unistd.h>
 
 #include "intl.h"
@@ -214,6 +215,7 @@ gint send_message_local(const gchar *command, FILE *fp)
        FILE *pipefp;
        gchar buf[BUFFSIZE];
        int r;
+       sigset_t osig, mask;
 
        g_return_val_if_fail(command != NULL, -1);
        g_return_val_if_fail(fp != NULL, -1);
@@ -233,9 +235,19 @@ gint send_message_local(const gchar *command, FILE *fp)
                fputc('\n', pipefp);
        }
 
+       /* we need to block SIGCHLD, otherwise pspell's handler will wait()
+        * the pipecommand away and pclose will return -1 because of its
+        * failed wait4().
+        */
+       sigemptyset(&mask);
+       sigaddset(&mask, SIGCHLD);
+       sigprocmask(SIG_BLOCK, &mask, &osig);
+       
        r = pclose(pipefp);
+
+       sigprocmask(SIG_SETMASK, &osig, NULL);
        if (r != 0) {
-               g_warning(_("external command failed: %s\n"), command);
+               g_warning(_("external command `%s' failed with code `%i'\n"), command, r);
                return -1;
        }