Commit Graph

15 Commits

Author SHA1 Message Date
Keith Packard 3caf671ed2 config/dbus: Initialize dbus fd to -1 so teardown doesn't use fd 0
The dbus teardown code is called when the server fatal errors even if
that is before dbus has ever been initialized.  By statically
initializing the value of bus_info.fd, we avoid calling RemoveNotifyFd
on stdin.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-15 21:30:38 -07:00
Keith Packard bf920b2390 config: Use NotifyFd for dbus interface
This uses the NotifyFd interface to monitor the dbus socket rather
than a block/wakeup handler.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:55:13 -05:00
Ray Strode bcb17b9987 dbus: don't dispatch dbus events on select() EINTR
wakeup handlers are called even when select() returns EINTR,
and when they're called the passed fd set is undefined.

This commit fixes the dbus wakeup handler to avoid dispatching
into dbus spuriously.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Ray Strode <rstrode@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-30 08:56:32 -07:00
Hans de Goede 33cec8af55 dbus-core: Attempt to connect to dbus ASAP
For systemd-logind integration we need the dbus connection to be available
before enumerating input and gfx devices.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2014-01-29 15:29:00 -08:00
Hans de Goede 480590b90c dbus-core: Make dbus-core no longer mutually exclusive with udev
With systemd-logind the dbus-core will be used for more then just config, so
it should be possible to build it even when using a non dbus dependent config
backend.

This patch also removes the config_ prefix from the dbus-core symbols.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2014-01-29 15:28:58 -08:00
Keith Packard 60014a4a98 Replace 'pointer' type with 'void *'
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer'
is used throughout the X server for other things, and having duplicate
names generates compiler warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12 10:24:11 -08:00
Keith Packard 9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21 13:54:42 -07:00
Tomas Carnecky e04d9ab999 DBUS_API_SUBJECT_TO_CHANGE is already defined on the command line
dbus-core.c:30:1: warning: "DBUS_API_SUBJECT_TO_CHANGE" redefined
<command-line>: warning: this is the location of the previous definition

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-04 09:49:54 +10:00
Peter Hutterer d232665223 config: check connection != NULL before getting dbus' dispatch status. 2008-01-25 13:54:47 +10:30
Daniel Stone f44fd3f9e4 Config: D-Bus: Don't leak timers
TimerCancel doesn't free the timer: you need TimerFree for that.
2007-12-28 15:51:36 +02:00
Aaron Plattner 3a965fdadc Don't segfault on shutdown if we never managed to connect to dbus. 2007-09-20 16:22:24 -07:00
Daniel Stone 0a31db14b7 Config: D-Bus core: Fix hook removal
Make sure we properly initialise the entire hook when adding it, and
bust out when we're done removing.
2007-08-01 03:33:05 +03:00
Daniel Stone 1150969b82 Convert all my license statements to the standard form
Convert all my license statements to the standard, accepted form:
cf. <20070717142307.GD13478@fooishbar.org>
    http://lists.freedesktop.org/archives/xorg/2007-July/026451.html

keithp's license on configure.ac changed with his verbal permission.
2007-08-01 01:53:31 +03:00
Daniel Stone aa75b34817 Hotplug: D-Bus: Dispatch harder
Dispatch until we've got nothing left to dispatch, since apparently
dispatching will only ever fire a single message ...
2007-08-01 01:53:31 +03:00
Daniel Stone 1cdadc2f43 Hotplug: Separate D-Bus into core and hotplug API components
Break up D-Bus into two components: a D-Bus core that can be used by any
part of the server (for the moment, just the D-Bus hotplug API, and the
forthcoming HAL hotplug API), and the old D-Bus hotplug API.
2007-08-01 01:53:31 +03:00