summaryrefslogtreecommitdiff
path: root/udev-add.c
diff options
context:
space:
mode:
authorgreg@kroah.com <greg@kroah.com>2003-12-08 09:40:40 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:13:06 -0700
commit7ac0feeb6044470569d7ece5d34a76acdb03fc64 (patch)
tree0739df0c77486dfdf34a486a662ff62967240dae /udev-add.c
parent5aebfbcb62614fc2bf2b1579d62e3fe272c6751a (diff)
[PATCH] move all of the DBUS logic into one file and remove all of the #ifdef crud from the main code.
Diffstat (limited to 'udev-add.c')
-rw-r--r--udev-add.c44
1 files changed, 3 insertions, 41 deletions
diff --git a/udev-add.c b/udev-add.c
index 174331fade..8d45b26077 100644
--- a/udev-add.c
+++ b/udev-add.c
@@ -36,6 +36,7 @@
#include "udev.h"
#include "udev_version.h"
+#include "udev_dbus.h"
#include "namedev.h"
#include "udevdb.h"
#include "libsysfs/libsysfs.h"
@@ -100,42 +101,6 @@ static int create_path(char *file)
return 0;
}
-#ifdef USE_DBUS
-/** Send out a signal that a device node is created
- *
- * @param dev udevice object
- * @param path Sysfs path of device
- */
-static void sysbus_send_create(struct udevice *dev, const char *path)
-{
- char filename[255];
- DBusMessage* message;
- DBusMessageIter iter;
-
- if (sysbus_connection == NULL)
- return;
-
- strncpy(filename, udev_root, sizeof(filename));
- strncat(filename, dev->name, sizeof(filename));
-
- /* object, interface, member */
- message = dbus_message_new_signal("/org/kernel/udev/NodeMonitor",
- "org.kernel.udev.NodeMonitor",
- "NodeCreated");
-
- dbus_message_iter_init(message, &iter);
- dbus_message_iter_append_string(&iter, filename);
- dbus_message_iter_append_string(&iter, path);
-
- if ( !dbus_connection_send(sysbus_connection, message, NULL) )
- dbg("error sending d-bus signal");
-
- dbus_message_unref(message);
-
- dbus_connection_flush(sysbus_connection);
-}
-#endif /* USE_DBUS */
-
/*
* we possibly want to add some symlinks here
* only numeric owner/group id's are supported
@@ -359,11 +324,8 @@ int udev_add_device(char *path, char *subsystem)
dbg("name='%s'", dev.name);
retval = create_node(&dev);
-#ifdef USE_DBUS
- if (retval == 0) {
- sysbus_send_create(&dev, path);
- }
-#endif /* USE_DBUS */
+ if (retval == 0)
+ sysbus_send_create(&dev, path);
exit:
if (class_dev)