mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-07 12:25:38 +00:00
altos: Only shutdown the IO channel if it was created
This commit is contained in:
parent
3ba0b29ba3
commit
6174425ee1
@ -187,11 +187,13 @@ fu_altos_device_tty_open (FuAltosDevice *self, GError **error)
|
|||||||
static gboolean
|
static gboolean
|
||||||
fu_altos_device_tty_close (FuAltosDevice *self, GError **error)
|
fu_altos_device_tty_close (FuAltosDevice *self, GError **error)
|
||||||
{
|
{
|
||||||
tcsetattr (fu_io_channel_unix_get_fd (self->io_channel),
|
if (self->io_channel != NULL) {
|
||||||
TCSAFLUSH, &self->tty_termios);
|
tcsetattr (fu_io_channel_unix_get_fd (self->io_channel),
|
||||||
if (!fu_io_channel_shutdown (self->io_channel, error))
|
TCSAFLUSH, &self->tty_termios);
|
||||||
return FALSE;
|
if (!fu_io_channel_shutdown (self->io_channel, error))
|
||||||
g_clear_object (&self->io_channel);
|
return FALSE;
|
||||||
|
g_clear_object (&self->io_channel);
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user