NetworkManager r3530 - in trunk: . src
- From: dcbw svn gnome org
- To: svn-commits-list gnome org
- Subject: NetworkManager r3530 - in trunk: . src
- Date: Fri, 4 Apr 2008 15:59:30 +0100 (BST)
Author: dcbw
Date: Fri Apr 4 15:59:30 2008
New Revision: 3530
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3530&view=rev
Log:
2008-04-04 Dan Williams <dcbw redhat com>
* src/nm-hal-manager.c
src/nm-hal-manager.h
- (hal_init): don't look for hardware here
- (nm_hal_manager_start): new function; look for hardware here instead,
which can be done at a later time than hal_init()
* src/NetworkManager.c
- (main): start HAL manager after entering the main loop
Modified:
trunk/ChangeLog
trunk/src/NetworkManager.c
trunk/src/nm-hal-manager.c
trunk/src/nm-hal-manager.h
Modified: trunk/src/NetworkManager.c
==============================================================================
--- trunk/src/NetworkManager.c (original)
+++ trunk/src/NetworkManager.c Fri Apr 4 15:59:30 2008
@@ -205,6 +205,13 @@
nm_warning ("Closing %s failed: %s", pidfile, strerror (errno));
}
+static gboolean
+start_hal (gpointer user_data)
+{
+ nm_hal_manager_start ((NMHalManager *) user_data);
+ return FALSE;
+}
+
/*
* main
*
@@ -343,6 +350,7 @@
hal_manager = nm_hal_manager_new (manager);
if (!hal_manager)
goto done;
+ g_idle_add (start_hal, hal_manager);
/* Bring up the loopback interface. */
nm_system_enable_loopback ();
Modified: trunk/src/nm-hal-manager.c
==============================================================================
--- trunk/src/nm-hal-manager.c (original)
+++ trunk/src/nm-hal-manager.c Fri Apr 4 15:59:30 2008
@@ -569,7 +569,6 @@
{
DBusError error;
DBusGConnection *connection;
- gboolean success = FALSE;
manager->hal_ctx = libhal_ctx_new ();
if (!manager->hal_ctx) {
@@ -586,7 +585,7 @@
nm_error ("libhal_ctx_init() failed: %s\n"
"Make sure the hal daemon is running?",
error.message);
- goto out;
+ goto error;
}
libhal_ctx_set_user_data (manager->hal_ctx, manager);
@@ -598,25 +597,19 @@
if (dbus_error_is_set (&error)) {
nm_error ("libhal_device_property_watch_all(): %s", error.message);
libhal_ctx_shutdown (manager->hal_ctx, NULL);
- goto out;
+ goto error;
}
- /* Add any devices we know about */
- add_killswitch_devices (manager);
- add_initial_devices (manager);
- success = TRUE;
+ return TRUE;
-out:
- if (!success) {
- if (dbus_error_is_set (&error))
- dbus_error_free (&error);
- if (manager->hal_ctx) {
- libhal_ctx_free (manager->hal_ctx);
- manager->hal_ctx = NULL;
- }
+error:
+ if (dbus_error_is_set (&error))
+ dbus_error_free (&error);
+ if (manager->hal_ctx) {
+ libhal_ctx_free (manager->hal_ctx);
+ manager->hal_ctx = NULL;
}
-
- return success;
+ return FALSE;
}
static void
@@ -748,6 +741,14 @@
return manager;
}
+void
+nm_hal_manager_start (NMHalManager *manager)
+{
+ /* Find hardware we care about */
+ add_killswitch_devices (manager);
+ add_initial_devices (manager);
+}
+
static void
destroy_creator (gpointer data, gpointer user_data)
{
Modified: trunk/src/nm-hal-manager.h
==============================================================================
--- trunk/src/nm-hal-manager.h (original)
+++ trunk/src/nm-hal-manager.h Fri Apr 4 15:59:30 2008
@@ -6,6 +6,7 @@
typedef struct _NMHalManager NMHalManager;
NMHalManager *nm_hal_manager_new (NMManager *nm_manager);
+void nm_hal_manager_start (NMHalManager *manager);
void nm_hal_manager_destroy (NMHalManager *manager);
#endif /* NM_HAL_MANAGER_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]