mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
tty.c: Refactor, move LIST_REMOVE() to tty_unregister()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -119,7 +119,6 @@ void tty_sweep(void)
|
||||
|
||||
if (tty->dirty == -1) {
|
||||
_d("TTY %s removed, cleaning up.", tty->data.name);
|
||||
LIST_REMOVE(tty, link);
|
||||
tty_unregister(tty);
|
||||
}
|
||||
}
|
||||
@@ -292,6 +291,8 @@ int tty_unregister(tty_node_t *tty)
|
||||
return errno = EINVAL;
|
||||
}
|
||||
|
||||
LIST_REMOVE(tty, link);
|
||||
|
||||
if (tty->data.name)
|
||||
free(tty->data.name);
|
||||
if (tty->data.baud)
|
||||
|
||||
Reference in New Issue
Block a user