NetworkManager r3679 - in trunk: . src



Author: tambeti
Date: Thu May 22 12:36:07 2008
New Revision: 3679
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3679&view=rev

Log:
2008-05-22  Tambet Ingo  <tambet gmail com>

	* src/nm-gsm-device.c (device_state_changed): Make sure we don't leave the
	serial device open when we're not connecting or connected.

	* src/nm-cdma-device.c (device_state_changed): Ditto.


Modified:
   trunk/ChangeLog
   trunk/src/nm-cdma-device.c
   trunk/src/nm-gsm-device.c

Modified: trunk/src/nm-cdma-device.c
==============================================================================
--- trunk/src/nm-cdma-device.c	(original)
+++ trunk/src/nm-cdma-device.c	Thu May 22 12:36:07 2008
@@ -385,6 +385,19 @@
 	 */
 	if (state == NM_DEVICE_STATE_UNAVAILABLE)
 		priv->state_to_disconnected_id = g_idle_add (unavailable_to_disconnected, self);
+
+	/* Make sure we don't leave the serial device open */
+	switch (state) {
+	case NM_DEVICE_STATE_NEED_AUTH:
+	case NM_DEVICE_STATE_UNMANAGED:
+	case NM_DEVICE_STATE_UNAVAILABLE:
+	case NM_DEVICE_STATE_FAILED:
+	case NM_DEVICE_STATE_DISCONNECTED:
+		nm_serial_device_close (NM_SERIAL_DEVICE (self));
+		break;
+	default:
+		break;
+	}
 }
 
 static GObject*

Modified: trunk/src/nm-gsm-device.c
==============================================================================
--- trunk/src/nm-gsm-device.c	(original)
+++ trunk/src/nm-gsm-device.c	Thu May 22 12:36:07 2008
@@ -697,6 +697,19 @@
 	 */
 	if (state == NM_DEVICE_STATE_UNAVAILABLE)
 		priv->state_to_disconnected_id = g_idle_add (unavailable_to_disconnected, self);
+
+	/* Make sure we don't leave the serial device open */
+	switch (state) {
+	case NM_DEVICE_STATE_NEED_AUTH:
+	case NM_DEVICE_STATE_UNMANAGED:
+	case NM_DEVICE_STATE_UNAVAILABLE:
+	case NM_DEVICE_STATE_FAILED:
+	case NM_DEVICE_STATE_DISCONNECTED:
+		nm_serial_device_close (NM_SERIAL_DEVICE (self));
+		break;
+	default:
+		break;
+	}
 }
 
 static GObject*



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]