summaryrefslogtreecommitdiff
path: root/libhal
diff options
context:
space:
mode:
authorDavid Zeuthen <david@fubar.dk>2003-12-08 22:01:44 +0000
committerDavid Zeuthen <david@fubar.dk>2003-12-08 22:01:44 +0000
commit656008dee085d23daf65dab8356e49d018cc305d (patch)
tree6db1a15440971ed1b5c7e433e8e9655bcc64514e /libhal
parent6a751c825d0b08ad1b879c704b45b1562df7f5cd (diff)
s/volume./block./ (udev_filter_func): new function for filtering D-BUS
messages from udev (setup_udev_listener): setup filter for udev messages (hal_monitor_enter): Listen to D-BUS messages Use global sysfs path (device_hotplug_add): Use global sysfs path (device_hotplug_remove): Use global sysfs path (drivers_collect): Use global sysfs path (mainloop_integration): Save D-BUS connection object for later use (main): Get sysfs mount path once and for all Add dbus_connection and sysfs_mount_path as extern variables new function (filter_function): add check for Device.QueryCapability Minor formatting stuff Crude example of volume manager now that we got udev integration in place. It doesn't really mount anything but prints out when it should mount. You'll need a very recent udev from BitKeeper with D-BUS enabled (got the patch accepted today)
Diffstat (limited to 'libhal')
-rw-r--r--libhal/libhal.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libhal/libhal.c b/libhal/libhal.c
index 3bf3a135..6f22397d 100644
--- a/libhal/libhal.c
+++ b/libhal/libhal.c
@@ -451,6 +451,8 @@ static DBusHandlerResult filter_func(DBusConnection* connection,
object_path = dbus_message_get_path(message);
+ /*printf("*** in filter_func, object_path=%s\n", object_path);*/
+
if( dbus_message_is_signal(message, "org.freedesktop.Hal.Manager",
"DeviceAdded") )
{
@@ -631,7 +633,11 @@ int hal_initialize(const LibHalFunctions* cb_functions)
}
// TODO: narrow in instead of match *all* signals
- dbus_bus_add_match(connection, "type='signal',interface='org.freedesktop.Hal.Manager',sender='org.freedesktop.Hal',path='/org/freedesktop/Hal/Manager'", &error);
+ dbus_bus_add_match(connection,
+ "type='signal',"
+ "interface='org.freedesktop.Hal.Manager',"
+ "sender='org.freedesktop.Hal',"
+ "path='/org/freedesktop/Hal/Manager'", &error);
if( dbus_error_is_set(&error) )
{
fprintf(stderr, "%s %d : Error subscribing to signals, "