mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-03 21:50:27 +01:00
2004-10-26 John (J5) Palmieri <johnp@redhat.com>
* info-daemon/NetworkManagerInfoDbus.c
- (nmi_dbus_is_running): New function for determining if nmi is already running
- (nmi_dbus_service_init): exit if another instance of nmi is already running
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@273 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
9c509ddd01
commit
1ecd3ef927
2 changed files with 30 additions and 1 deletions
|
|
@ -1,3 +1,9 @@
|
|||
2004-10-26 John (J5) Palmieri <johnp@redhat.com>
|
||||
|
||||
* info-daemon/NetworkManagerInfoDbus.c
|
||||
- (nmi_dbus_is_running): New function for determining if nmi is already running
|
||||
- (nmi_dbus_service_init): exit if another instance of nmi is already running
|
||||
|
||||
2004-10-23 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* info-daemon/NetworkManagerInfoDbus.c
|
||||
|
|
|
|||
|
|
@ -706,9 +706,28 @@ static DBusHandlerResult nmi_dbus_filter (DBusConnection *connection, DBusMessag
|
|||
return (handled ? DBUS_HANDLER_RESULT_HANDLED : DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
|
||||
}
|
||||
|
||||
/*
|
||||
* nmi_dbus_is_running
|
||||
*
|
||||
* Ask dbus whether or not another instance of NetworkManagerInfo is running
|
||||
*
|
||||
*/
|
||||
static gboolean nmi_dbus_is_running (DBusConnection *connection)
|
||||
{
|
||||
DBusError error;
|
||||
gboolean exists;
|
||||
|
||||
g_return_val_if_fail (connection != NULL, FALSE);
|
||||
|
||||
dbus_error_init (&error);
|
||||
exists = dbus_bus_service_exists (connection, NMI_DBUS_SERVICE, &error);
|
||||
if (dbus_error_is_set (&error))
|
||||
dbus_error_free (&error);
|
||||
return (exists);
|
||||
}
|
||||
|
||||
/*
|
||||
* nmwa_dbus_nm_is_running
|
||||
* nmi_dbus_nm_is_running
|
||||
*
|
||||
* Ask dbus whether or not NetworkManager is running
|
||||
*
|
||||
|
|
@ -738,6 +757,10 @@ int nmi_dbus_service_init (DBusConnection *dbus_connection, NMIAppInfo *info)
|
|||
DBusError dbus_error;
|
||||
DBusObjectPathVTable nmi_vtable = { &nmi_dbus_nmi_unregister_handler, &nmi_dbus_nmi_message_handler, NULL, NULL, NULL, NULL };
|
||||
|
||||
/*return if we are already running in another instance*/
|
||||
if (nmi_dbus_is_running (dbus_connection))
|
||||
return (-1);
|
||||
|
||||
dbus_error_init (&dbus_error);
|
||||
dbus_bus_acquire_service (dbus_connection, NMI_DBUS_SERVICE, 0, &dbus_error);
|
||||
if (dbus_error_is_set (&dbus_error))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue