evolution r37149 - trunk/plugins/bogo-junk-plugin
- From: tml svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution r37149 - trunk/plugins/bogo-junk-plugin
- Date: Wed, 28 Jan 2009 17:21:19 +0000 (UTC)
Author: tml
Date: Wed Jan 28 17:21:19 2009
New Revision: 37149
URL: http://svn.gnome.org/viewvc/evolution?rev=37149&view=rev
Log:
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.
Modified:
trunk/plugins/bogo-junk-plugin/ChangeLog
trunk/plugins/bogo-junk-plugin/Makefile.am
trunk/plugins/bogo-junk-plugin/bf-junk-filter.c
Modified: trunk/plugins/bogo-junk-plugin/Makefile.am
==============================================================================
--- trunk/plugins/bogo-junk-plugin/Makefile.am (original)
+++ trunk/plugins/bogo-junk-plugin/Makefile.am Wed Jan 28 17:21:19 2009
@@ -10,6 +10,9 @@
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
Modified: trunk/plugins/bogo-junk-plugin/bf-junk-filter.c
==============================================================================
--- trunk/plugins/bogo-junk-plugin/bf-junk-filter.c (original)
+++ trunk/plugins/bogo-junk-plugin/bf-junk-filter.c Wed Jan 28 17:21:19 2009
@@ -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 @@
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 @@
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) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]