diff options
author | Tor Lillqvist <tml@novell.com> | 2009-01-29 01:21:19 +0800 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2009-01-29 01:21:19 +0800 |
commit | 0dfe01e99b855b7c027136f0f6e6de5b004b46ae (patch) | |
tree | fa682ffa5db294746f991ca1b296bb7ae8e1bdc9 /plugins/bogo-junk-plugin/bf-junk-filter.c | |
parent | b95a3586e3af5aad0e4c3322faa4daa06cf7b647 (diff) | |
download | gsoc2013-evolution-0dfe01e99b855b7c027136f0f6e6de5b004b46ae.tar gsoc2013-evolution-0dfe01e99b855b7c027136f0f6e6de5b004b46ae.tar.gz gsoc2013-evolution-0dfe01e99b855b7c027136f0f6e6de5b004b46ae.tar.bz2 gsoc2013-evolution-0dfe01e99b855b7c027136f0f6e6de5b004b46ae.tar.lz gsoc2013-evolution-0dfe01e99b855b7c027136f0f6e6de5b004b46ae.tar.xz 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
Diffstat (limited to 'plugins/bogo-junk-plugin/bf-junk-filter.c')
-rw-r--r-- | plugins/bogo-junk-plugin/bf-junk-filter.c | 17 |
1 files changed, 14 insertions, 3 deletions
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) { |