aboutsummaryrefslogtreecommitdiff
path: root/src/mm-serial-port.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mm-serial-port.c')
-rw-r--r--src/mm-serial-port.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/mm-serial-port.c b/src/mm-serial-port.c
index 57820c1..0f81c7b 100644
--- a/src/mm-serial-port.c
+++ b/src/mm-serial-port.c
@@ -937,7 +937,9 @@ mm_serial_port_open (MMSerialPort *self, GError **error)
*/
if (ioctl (priv->fd, TIOCGSERIAL, &sinfo) == 0) {
sinfo.closing_wait = ASYNC_CLOSING_WAIT_NONE;
- ioctl (priv->fd, TIOCSSERIAL, &sinfo);
+ if (ioctl (priv->fd, TIOCSSERIAL, &sinfo) < 0)
+ mm_warn ("(%s): couldn't set serial port closing_wait to none: %s",
+ device, g_strerror (errno));
}
g_get_current_time (&tv_end);
@@ -1027,7 +1029,9 @@ mm_serial_port_close (MMSerialPort *self)
if (sinfo.closing_wait != ASYNC_CLOSING_WAIT_NONE) {
mm_warn ("(%s): serial port closing_wait was reset!", device);
sinfo.closing_wait = ASYNC_CLOSING_WAIT_NONE;
- (void) ioctl (priv->fd, TIOCSSERIAL, &sinfo);
+ if (ioctl (priv->fd, TIOCSSERIAL, &sinfo) < 0)
+ mm_warn ("(%s): couldn't set serial port closing_wait to none: %s",
+ device, g_strerror (errno));
}
}
@@ -1592,11 +1596,7 @@ set_property (GObject *object, guint prop_id,
priv->bits = g_value_get_uint (value);
break;
case PROP_PARITY:
-#if GLIB_CHECK_VERSION(2,31,0)
priv->parity = g_value_get_schar (value);
-#else
- priv->parity = g_value_get_char (value);
-#endif
break;
case PROP_STOPBITS:
priv->stopbits = g_value_get_uint (value);
@@ -1636,11 +1636,7 @@ get_property (GObject *object, guint prop_id,
g_value_set_uint (value, priv->bits);
break;
case PROP_PARITY:
-#if GLIB_CHECK_VERSION(2,31,0)
g_value_set_schar (value, priv->parity);
-#else
- g_value_set_char (value, priv->parity);
-#endif
break;
case PROP_STOPBITS:
g_value_set_uint (value, priv->stopbits);