mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-06 09:00:55 +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
|
||||
fu_altos_device_tty_close (FuAltosDevice *self, GError **error)
|
||||
{
|
||||
tcsetattr (fu_io_channel_unix_get_fd (self->io_channel),
|
||||
TCSAFLUSH, &self->tty_termios);
|
||||
if (!fu_io_channel_shutdown (self->io_channel, error))
|
||||
return FALSE;
|
||||
g_clear_object (&self->io_channel);
|
||||
if (self->io_channel != NULL) {
|
||||
tcsetattr (fu_io_channel_unix_get_fd (self->io_channel),
|
||||
TCSAFLUSH, &self->tty_termios);
|
||||
if (!fu_io_channel_shutdown (self->io_channel, error))
|
||||
return FALSE;
|
||||
g_clear_object (&self->io_channel);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user