aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2009-01-29 01:21:19 +0800
committerTor Lillqvist <tml@src.gnome.org>2009-01-29 01:21:19 +0800
commit0dfe01e99b855b7c027136f0f6e6de5b004b46ae (patch)
treefa682ffa5db294746f991ca1b296bb7ae8e1bdc9
parentb95a3586e3af5aad0e4c3322faa4daa06cf7b647 (diff)
downloadgsoc2013-evolution-0dfe01e99b855b7c027136f0f6e6de5b004b46ae.tar.gz
gsoc2013-evolution-0dfe01e99b855b7c027136f0f6e6de5b004b46ae.tar.zst
gsoc2013-evolution-0dfe01e99b855b7c027136f0f6e6de5b004b46ae.zip
Use -no-undefined on Windows. Link with libeutil.
2009-01-28 Tor Lillqvist <tml@novell.com> * Makefile.am: Use -no-undefined on Windows. Link with libeutil. * bf-junk-filter.c: Tentative port to Windows even though this plugin isn't even compiled on Windows for now. Just for completeness. svn path=/trunk/; revision=37149
-rw-r--r--plugins/bogo-junk-plugin/ChangeLog8
-rw-r--r--plugins/bogo-junk-plugin/Makefile.am3
-rw-r--r--plugins/bogo-junk-plugin/bf-junk-filter.c17
3 files changed, 25 insertions, 3 deletions
diff --git a/plugins/bogo-junk-plugin/ChangeLog b/plugins/bogo-junk-plugin/ChangeLog
index e4007d4525..b24ac0db6c 100644
--- a/plugins/bogo-junk-plugin/ChangeLog
+++ b/plugins/bogo-junk-plugin/ChangeLog
@@ -1,3 +1,11 @@
+2009-01-28 Tor Lillqvist <tml@novell.com>
+
+ * Makefile.am: Use -no-undefined on Windows. Link with libeutil.
+
+ * bf-junk-filter.c: Tentative port to Windows even though this
+ plugin isn't even compiled on Windows for now. Just for
+ completeness.
+
2008-12-15 srinivasa ragavan <sragavan@novell.com>
* makefile.am:
diff --git a/plugins/bogo-junk-plugin/Makefile.am b/plugins/bogo-junk-plugin/Makefile.am
index 886d60392d..24eb99fdd5 100644
--- a/plugins/bogo-junk-plugin/Makefile.am
+++ b/plugins/bogo-junk-plugin/Makefile.am
@@ -10,6 +10,9 @@ plugin_LTLIBRARIES = liborg-gnome-bogo-junk-plugin.la
liborg_gnome_bogo_junk_plugin_la_SOURCES = bf-junk-filter.c
liborg_gnome_bogo_junk_plugin_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED)
+liborg_gnome_bogo_junk_plugin_la_LIBADD = \
+ $(GNOME_PLATFORM_LIBS) \
+ $(top_builddir)/e-util/libeutil.la
schemadir = $(GCONF_SCHEMA_FILE_DIR)
schema_in_files = bogo-junk-plugin.schemas.in
diff --git a/plugins/bogo-junk-plugin/bf-junk-filter.c b/plugins/bogo-junk-plugin/bf-junk-filter.c
index aca10643e8..848e4f4fb5 100644
--- a/plugins/bogo-junk-plugin/bf-junk-filter.c
+++ b/plugins/bogo-junk-plugin/bf-junk-filter.c
@@ -25,7 +25,6 @@
#include "config.h"
#endif
-#include <sys/wait.h>
#include <signal.h>
#include <unistd.h>
#include <errno.h>
@@ -34,6 +33,13 @@
#define G_LOG_DOMAIN "bf-junk-filter"
#include <glib.h>
+
+#ifndef G_OS_WIN32
+# include <sys/wait.h>
+#else
+# include <windows.h>
+#endif
+
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <e-util/e-plugin.h>
@@ -163,6 +169,7 @@ retry:
camel_stream_close (stream);
camel_object_unref (stream);
+#ifndef G_OS_WIN32
waitres = waitpid (child_pid, &status, 0);
if (waitres < 0 && errno == EINTR) {
/* child process is hanging... */
@@ -181,13 +188,17 @@ retry:
g_set_error (error, EM_JUNK_ERROR, -3, _("Wait for Bogofilter child process interrupted, terminating..."));
}
- g_spawn_close_pid (child_pid);
-
if (waitres >= 0 && WIFEXITED (status)) {
res = WEXITSTATUS (status);
} else {
res = BOGOFILTER_ERROR;
}
+#else
+ WaitForSingleObject (child_pid, INFINITE);
+ GetExitCodeProcess (child_pid, &res);
+#endif
+
+ g_spawn_close_pid (child_pid);
if (res < 0 || res > 2) {
if (!only_once) {