terminal-util: refactor vt_disallocate()
authorLennart Poettering <lennart@poettering.net>
Thu, 11 Jul 2024 15:45:34 +0000 (17:45 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 19 Jul 2024 09:44:04 +0000 (11:44 +0200)
commit45d785dfc03f5b7ec62faf69e6d7ff18c807b93d
treea824c19a6d1b2ba73fbbc8c26990638de61ea4a5
parent7147e10c9e316b9345246b00a6b3ddf93e45cbc0
terminal-util: refactor vt_disallocate()

Numerous fixes:

1. use vtnr_from_tty() to parse out VT number from tty path
2. open tty for write only when we want to output just ansi sequences
3. open tty in asynchronous mode, and apply a timeout, just to be safe
4. propagate error from writing (most callers ignore it anyway, might as
   well pass it along correctly)
src/basic/terminal-util.c