Romain Pokrzywka [Thu, 14 Jan 2010 07:59:22 +0000 (08:59 +0100)]
fixes bug where sometimes objects were not unregistered from dbus
although their app had exited. As it turns out it was a missing
implementation of the method _dbus_fd_set_close_on_exec() for windows.
It's been tested with msvc2005, msvc2008, and mingw, and solves
all the unregistering issues on many kde apps.
Will Thompson [Thu, 30 Jul 2009 09:49:33 +0000 (10:49 +0100)]
Group match rules by their interface.
In my informal studies of "normal" sets of match rules, only checking
match rules with the appropriate interface for the message reduces the
number that need to be checked by almost 100x on average (ranging from
halving for messages from the bus daemon, to a >200x reduction in many
cases). This reduces the overhead added to dispatching each message by
having lots of irrelevant match rules.
Will Thompson [Wed, 29 Jul 2009 16:53:37 +0000 (17:53 +0100)]
Don't bother re-matching features we've checked.
This is currently not a big deal, but will make more of a difference
once the set of match rules is partitioned by more features than just
the message type.
Colin Walters [Mon, 14 Dec 2009 23:12:24 +0000 (18:12 -0500)]
Ignore exit code zero from activated services
A variety of system components have migrated from legacy init into DBus
service activation. Many of these system components "daemonize", which
involves forking. The DBus activation system treated an exit as an
activation failure, assuming that the child process which grabbed the
DBus name didn't run first.
While we're in here, also differentiate in this code path between the
servicehelper (system) versus direct activation (session) paths. In
the session activation path our error message mentioned a helper
process which was confusing, since none was involved.
Based on a patch and debugging research from Ray Strode <rstrode@redhat.com>
Tor Lillqvist [Thu, 22 Oct 2009 10:19:23 +0000 (13:19 +0300)]
Handle also WinSock errors in _dbus_error_from_errno
Handle those WinSock errors that match the errno values handled. Don't
bother handling those errors that are mapped to DBUS_ERROR_FAILED in
the switch as that is the default return value anyway.
Frank Osterfeld [Thu, 22 Oct 2009 10:03:11 +0000 (13:03 +0300)]
Windows fixes
Replace dbus_daemon_init() by dbus_publish_session_bus_address(),
publishing the full address. Omit username from mutexes (not necessary
as mutex names are local to session). Don't exit if publishing the
address failed (allow multiple session bus instances per
session). Based on 00ee92ae314 by Tor Lillqvist.
Cherry-picked from commit 23945513e9a4da61d286ebfbce3897aa061ddbfe in
the dbus4win repository by tml@iki.fi. Remove claim of that commit not
being merged from README.dbus4win.
Tor Lillqvist [Thu, 22 Oct 2009 00:22:54 +0000 (03:22 +0300)]
Avoid warnings on Windows
Remove unused functions, or put in #if 0 if potentially useful. Make
internal functions used just in one file static. Use -Werror after all
also on Windows. Construct the installation root from the location of
the dbus DLL, not from the location of the program .exe of the
process.
Tor Lillqvist [Wed, 21 Oct 2009 18:52:59 +0000 (21:52 +0300)]
Don't use DBUS_DIR_SEPARATOR
I didn't cherry-pick the commit from dbus4win that introduced
DBUS_DIR_SEPARATOR, as I think it just uglifies the code with little
gain. (Forward) slashes work fine on Windows.
Tor Lillqvist [Wed, 21 Oct 2009 12:31:34 +0000 (15:31 +0300)]
Use multi-byte string functions on Windows
Don't walk through char arrays that contain strings in the system
codepage char by char looking for '\\'. There are double-byte
characters in East Asian codepages where the second byte is a '\\'.
(cherry picked from commit 61316262da466993abbcba010c6bac90bb0b1d43)
Frank Osterfeld [Wed, 21 Oct 2009 17:08:12 +0000 (20:08 +0300)]
Improve error handling in nonce code
Replace errno (from assuan code) by DBusError. Errors are not passed
through dbus_accept_with_nonce atm, as the original _dbus_accept() has
no error arg either.
bus/Makefile.am: make dbus-daemon and friends bin_PROGRAMS on Windows
On Linux, dbus-daemon and dbus-daemon-launch-helper are treated specially
because they need permission adjustment.
On Windows, all executables are stubs, created by libtool. The real
executables are in .libs. We need to use libtool to install them
properly. So let's make them bin_PROGRAMS on Windows.
(cherry picked from commit 7fb35992d67433ac3ba82e9e2e786e123323456d)
Move some functions from dbus-sysdeps-util-win.c to dbus-sysdeps-win.c
These are used by dbus-sysdeps-win.c and it is not linked together
with dbus-sysdeps-util-win.c
(cherry picked from commit 24b612adbf8045b8b00af15f8d44eb38f964641f)
Marc Mutz [Fri, 17 Apr 2009 12:07:25 +0000 (14:07 +0200)]
WIN32: add versioninfo, and export symbols
* dbus/versioninfo.rc.in: (new file) copied and modified from libgpg-error
* configure.in: enable libtool's W32 support, extract version information
for use in versioninfo.rc.in, define DBUS_WIN, define DBUS_UNIX only on
unix (adapted from libgpg-error)
* dbus/Makefile.am: switch sources depending on platform,
compile versioninfo.rc, add dbus-1.def (not used since buildsystem creates
its own .def file apparently)
(cherry picked from commit cfa717ddb7b9258a862d87cd5b3bdbe582ce106c)
Frank Osterfeld [Wed, 29 Apr 2009 16:03:32 +0000 (18:03 +0200)]
_dbus_get_install_root assumes that dbus-daemon is in a bin/ subdirectory. That's not a common directory structure on windows, so weaken the assumption: $somepath/bin/dbus-daemon.exe -> $somepath $somepath/dbus-daemon.exe, where somepath doesn't end in /bin/: -> $somepath i.e., use dbus-daemon.exe's directory as root if that directory is not a "bin" directory (cherry picked from commit 2d2055b2fa7f92c144e9a182a9a091ebe5215d7d)
Tor Lillqvist [Wed, 22 Apr 2009 14:35:43 +0000 (16:35 +0200)]
dbus/dbus-sysdeps-util-win.c: use GetFileAttributes instead of CreateFile in _dbus_file_exists (cherry picked from commit 3ba582b91361785c3eb0121e8b9e85d046eea75f)
Tor Lillqvist [Wed, 22 Apr 2009 11:35:11 +0000 (13:35 +0200)]
dbus/dbus-sysdeps-win.c: add _dbus_win_error_string, and use after MoveFileEx instead of _dbus_error_from_errno (cherry picked from commit 1d0b2dacf52faffbeba09af2b309683ccc71547a)