aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRadek Doulik <rodo@ximian.com>2004-02-13 02:59:17 +0800
committerRadek Doulik <rodo@src.gnome.org>2004-02-13 02:59:17 +0800
commit0d419fd0f5920bfbcc6e21a5db432fc6a3e32ee3 (patch)
treecd7e049b42f6a0278f375662b77672d5e45f35ef
parentde39319a4c96cecc0a3e4d224d83fd8f8426696d (diff)
downloadgsoc2013-evolution-0d419fd0f5920bfbcc6e21a5db432fc6a3e32ee3.tar.gz
gsoc2013-evolution-0d419fd0f5920bfbcc6e21a5db432fc6a3e32ee3.tar.zst
gsoc2013-evolution-0d419fd0f5920bfbcc6e21a5db432fc6a3e32ee3.zip
use g_find_program_in_path to avoid fork in case program is not available
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 svn path=/trunk/; revision=24724
-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;