[patch] fix buffer allocation



Hi Dan,

This patch should fix small bug caused by commit 
31a34fa7ffbceb79d5e6c16158e5dcce285dcff1


<info>  Activation (ttyACM0) Stage 1 of 5 (Device Prepare) complete.
<WARN>  wait_for_reply_got_data(): (ttyACM0): response buffer filled before
repsonse received
<WARN>  init_done(): Modem initialization timed out
<info>  (ttyACM0): device state change: 4 -> 9
<debug> [1245064472.544906] nm_serial_device_close(): Closing device 'ttyACM0'


Thanks,
Rob
diff --git a/src/nm-serial-device.c b/src/nm-serial-device.c
index 54dd176..ad481d3 100644
--- a/src/nm-serial-device.c
+++ b/src/nm-serial-device.c
@@ -368,7 +368,7 @@ config_fd (NMSerialDevice *device, NMSettingSerial *setting)
 	stbuf.c_cflag &= ~(CBAUD | CSIZE | CSTOPB | CLOCAL | PARENB);
 	stbuf.c_cflag |= (speed | bits | CREAD | 0 | parity | stopbits);
 
-	if (tcgetattr (priv->fd, &stbuf) < 0) {
+	if (tcsetattr (priv->fd, TCSANOW, &stbuf) < 0) {
 		nm_warning ("(%s) cannot control device (errno %d)",
 		            nm_device_get_iface (NM_DEVICE (device)), errno);
 		return FALSE;

Attachment: signature.asc
Description: This is a digitally signed message part.



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