From c94a07d1d4db42b28226b6cdb7eff8d32eb445fb Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 28 Feb 2012 12:48:59 +0000 Subject: [PATCH] DBusPipe: stub out the Windows implementation for Windows CE The Win32 implementation uses _write() and _close() from the C runtime, and according to MSDN those aren't available on WinCE. This should get the WinCE implementation to at least compile, although dbus-daemon.exe --print-address and --print-pid won't work. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46049 Signed-off-by: Simon McVittie --- dbus/dbus-pipe-win.c | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/dbus/dbus-pipe-win.c b/dbus/dbus-pipe-win.c index 9c7c257..b1dfcfb 100644 --- a/dbus/dbus-pipe-win.c +++ b/dbus/dbus-pipe-win.c @@ -29,7 +29,10 @@ #include "dbus-pipe.h" #include + +#ifndef DBUS_WINCE #include +#endif /** * write data to a pipe. @@ -48,6 +51,15 @@ _dbus_pipe_write (DBusPipe *pipe, int len, DBusError *error) { +#ifdef DBUS_WINCE + + dbus_set_error (error, DBUS_ERROR_NOT_SUPPORTED, + "Pipes are not currently supported on Windows CE, " + "see fd.o #46049"); + return -1; + +#else /* !DBUS_WINCE */ + const char *buffer_c = _dbus_string_get_const_data (buffer); int written; @@ -60,6 +72,8 @@ _dbus_pipe_write (DBusPipe *pipe, "Writing to pipe: %s", _dbus_strerror_from_errno ()); return -1; + +#endif /* !DBUS_WINCE */ } /** @@ -75,6 +89,15 @@ _dbus_pipe_close (DBusPipe *pipe, { _DBUS_ASSERT_ERROR_IS_CLEAR (error); +#ifdef DBUS_WINCE + + dbus_set_error (error, DBUS_ERROR_NOT_SUPPORTED, + "Pipes are not currently supported on Windows CE, " + "see fd.o #46049"); + return -1; + +#else /* !DBUS_WINCE */ + if (_close (pipe->fd) != 0) { dbus_set_error (error, _dbus_error_from_system_errno (), @@ -87,4 +110,6 @@ _dbus_pipe_close (DBusPipe *pipe, _dbus_pipe_invalidate (pipe); return 0; } + +#endif /* !DBUS_WINCE */ } -- 1.7.9.1