diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-02-13 19:54:52 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-02-28 12:37:41 +0000 |
commit | 1e35c693e474f341d03a525a54af93c101d4737d (patch) | |
tree | 053a3182867d2f360a985f0759e490710eb4bc19 /dbus/dbus-pipe-unix.c | |
parent | 5ed44952d9a4506d58878234cb09df8baa20461b (diff) | |
download | dbus-1e35c693e474f341d03a525a54af93c101d4737d.tar.gz |
Make dbus-daemon.exe --print-address work under Windows
The DBusPipe code was broken by commit 6e214b5b3c2837, which switched
from C runtime API to Win32 API for WinCE's benefit. In a DBusPipe,
fd_or_handle is in fact always a C runtime file descriptor, which can't
be used with the Win32 API (which expects a HANDLE).
This commit goes back to the C runtime API. It might cause WinCE support
to regress, but at least dbus-daemon.exe --print-address works again.
This is enough to make a few tests work under Wine when cross-compiling
from Linux to mingw-w64: in particular, this now works:
DBUS_TEST_DAEMON=bus/dbus-daemon.exe DBUS_TEST_DATA=test/data \
wine test/test-dbus-daemon.exe -p /echo/session
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46049
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Diffstat (limited to 'dbus/dbus-pipe-unix.c')
-rw-r--r-- | dbus/dbus-pipe-unix.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dbus/dbus-pipe-unix.c b/dbus/dbus-pipe-unix.c index 1a2806e2..cfc57044 100644 --- a/dbus/dbus-pipe-unix.c +++ b/dbus/dbus-pipe-unix.c @@ -50,7 +50,7 @@ _dbus_pipe_write (DBusPipe *pipe, { int written; - written = _dbus_write (pipe->fd_or_handle, buffer, start, len); + written = _dbus_write (pipe->fd, buffer, start, len); if (written < 0) { dbus_set_error (error, DBUS_ERROR_FAILED, @@ -71,7 +71,7 @@ int _dbus_pipe_close (DBusPipe *pipe, DBusError *error) { - if (!_dbus_close (pipe->fd_or_handle, error)) + if (!_dbus_close (pipe->fd, error)) { return -1; } |