mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-07 18:58:01 +02:00
[terminal] guard open and close against repeated calls
Since we have a status flag whether or not the terminal fd is open, use it in the open and close functions to guard against repeated calls.
This commit is contained in:
parent
b60eab0c4d
commit
faaa215e90
1 changed files with 6 additions and 0 deletions
|
|
@ -436,6 +436,9 @@ ply_terminal_open (ply_terminal_t *terminal)
|
|||
{
|
||||
assert (terminal != NULL);
|
||||
|
||||
if (terminal->is_open)
|
||||
return true;
|
||||
|
||||
ply_trace ("trying to open terminal '%s'", terminal->name);
|
||||
|
||||
if (!ply_terminal_open_device (terminal))
|
||||
|
|
@ -497,6 +500,9 @@ ply_terminal_is_active (ply_terminal_t *terminal)
|
|||
void
|
||||
ply_terminal_close (ply_terminal_t *terminal)
|
||||
{
|
||||
if (!terminal->is_open)
|
||||
return;
|
||||
|
||||
terminal->is_open = false;
|
||||
|
||||
ply_terminal_stop_watching_for_vt_changes (terminal);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue