terminal-util: when making /dev/null or the console stdio, forget cached terminal features

Let's forget all relevant terminal features we learnt when we make a
console or /dev/null stdin/stdout/stderr.

Also, while we are at it, let's drop the various _unlikely_ and
_likely_ annotiations around the terminal feature caches. In many cases
we call the relevant functions only once in which cases the annotations
are likely to do just harm and no good. After all we can't know if the
specific code will call us just once or many times...
This commit is contained in:
Lennart Poettering
2018-02-13 23:50:26 +01:00
parent 8854d79504
commit c6063244db
2 changed files with 37 additions and 20 deletions
+2
View File
@@ -98,7 +98,9 @@ int fd_columns(int fd);
unsigned columns(void);
int fd_lines(int fd);
unsigned lines(void);
void columns_lines_cache_reset(int _unused_ signum);
void reset_terminal_feature_caches(void);
bool on_tty(void);
bool terminal_is_dumb(void);