[PATCH] Do not restore termios on port close

Tomas.Jura at chello.at Tomas.Jura at chello.at
Sat Mar 26 14:43:13 UTC 2016


From: Tomas Jura <tomas.jura1 at gmail.com>

---
 src/mm-port-serial.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/src/mm-port-serial.c b/src/mm-port-serial.c
index 684b0ac..2b31dfe 100644
--- a/src/mm-port-serial.c
+++ b/src/mm-port-serial.c
@@ -90,7 +90,6 @@ struct _MMPortSerialPrivate {
     GSocket *socket;
     GSource *socket_source;
 
-    struct termios old_t;
 
     guint baud;
     guint bits;
@@ -1199,14 +1198,6 @@ mm_port_serial_open (MMPortSerial *self, GError **error)
         /* Flush any waiting IO */
         tcflush (self->priv->fd, TCIOFLUSH);
 
-        if (tcgetattr (self->priv->fd, &self->priv->old_t) < 0) {
-            errno_save = errno;
-            g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_OPEN_FAILED,
-                         "Could not set attributes on serial device %s: %s", device, strerror (errno_save));
-            mm_warn ("(%s) could not set attributes on serial device (%d)", device, errno_save);
-            goto error;
-        }
-
         /* Don't wait for pending data when closing the port; this can cause some
          * stupid devices that don't respond to URBs on a particular port to hang
          * for 30 seconds when probing fails.  See GNOME bug #630670.
@@ -1388,7 +1379,6 @@ _close_internal (MMPortSerial *self, gboolean force)
                 }
             }
 
-            tcsetattr (self->priv->fd, TCSANOW, &self->priv->old_t);
             tcflush (self->priv->fd, TCIOFLUSH);
         }
 
-- 
2.8.0.rc3



More information about the ModemManager-devel mailing list