aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/em-junk-filter.c8
2 files changed, 14 insertions, 0 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index b29cda1f6b..08b1efbce4 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,9 @@
+2004-02-12 Radek Doulik <rodo@ximian.com>
+
+ * em-junk-filter.c (pipe_to_sa_with_error): use
+ g_find_program_in_path to avoid fork in case program is not
+ available
+
2004-02-11 Jeffrey Stedfast <fejj@ximian.com>
* mail-component.c (mail_control_new): Disable the
diff --git a/mail/em-junk-filter.c b/mail/em-junk-filter.c
index 8e12b0efdd..ef5578e555 100644
--- a/mail/em-junk-filter.c
+++ b/mail/em-junk-filter.c
@@ -105,6 +105,7 @@ pipe_to_sa_with_error (CamelMimeMessage *msg, const char *in, char **argv, int r
{
int result, status, errnosav, fds[2];
CamelStream *stream;
+ char *program;
pid_t pid;
#if d(!)0
@@ -117,6 +118,13 @@ pipe_to_sa_with_error (CamelMimeMessage *msg, const char *in, char **argv, int r
printf ("\n");
}
#endif
+
+ program = g_find_program_in_path (argv [0]);
+ if (program == NULL) {
+ d(printf ("program not found, returning %d\n", rv_err));
+ return rv_err;
+ }
+ g_free (program);
if (pipe (fds) == -1) {
errnosav = errno;