NetworkManager r3410 - in trunk: . src



Author: dcbw
Date: Mon Mar 10 13:10:17 2008
New Revision: 3410
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3410&view=rev

Log:
2008-03-10  Dan Williams  <dcbw redhat com>

	* src/nm-serial-device.c
		- (config_fd): report error from TCSETA
		- (nm_serial_device_open): fail when config_fd() fails



Modified:
   trunk/ChangeLog
   trunk/src/nm-serial-device.c

Modified: trunk/src/nm-serial-device.c
==============================================================================
--- trunk/src/nm-serial-device.c	(original)
+++ trunk/src/nm-serial-device.c	Mon Mar 10 13:10:17 2008
@@ -241,7 +241,8 @@
 	stbuf.c_cflag |= (speed | bits | CREAD | 0 | parity | stopbits);
 
 	if (ioctl (priv->fd, TCSETA, &stbuf) < 0) {
-		g_warning ("Can not control device");
+		nm_warning ("(%s) cannot control device (errno %d)",
+		            nm_device_get_iface (NM_DEVICE (device)), errno);
 		return FALSE;
 	}
 
@@ -262,24 +263,27 @@
 	priv = NM_SERIAL_DEVICE_GET_PRIVATE (device);
 	iface = nm_device_get_iface (NM_DEVICE (device));
 
-	nm_debug ("Opening device '%s'", iface);
+	nm_debug ("(%s) opening device...", iface);
 
 	path = g_build_filename ("/dev", iface, NULL);
 	priv->fd = open (path, O_RDWR | O_EXCL | O_NONBLOCK | O_NOCTTY);
 	g_free (path);
 
 	if (priv->fd < 0) {
-		nm_warning ("Can not open device '%s'", iface);
+		nm_warning ("(%s) cannot open device (errno %d)", iface, errno);
 		return FALSE;
 	}
 
 	if (ioctl (priv->fd, TCGETA, &priv->old_t) < 0) {
-		nm_warning ("Can not control device '%s'", iface);
+		nm_warning ("(%s) cannot control device (errno %d)", iface, errno);
 		close (priv->fd);
 		return FALSE;
 	}
 
-	config_fd (device, setting);
+	if (!config_fd (device, setting)) {
+		close (priv->fd);
+		return FALSE;
+	}
 
 	priv->channel = g_io_channel_unix_new (priv->fd);
 



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