terminal-util: don't assume errno is correctly set when using isatty_safe()

let's instead generate ENOTTY on our own. This is more correct with out
coding style (since we generally do not propagate errors via errno), and
also addresses #34039 as side effect. (#34039 really needs to be fixed
in musl though, too, this is just a work-around as side-effect).

Fixes: #34039
This commit is contained in:
Lennart Poettering
2024-08-20 10:59:47 +02:00
parent 1b24357c41
commit aae47bf7a3
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -95,7 +95,7 @@ static int verify_tty(const char *name) {
return -errno;
if (!isatty_safe(fd))
return -errno;
return -ENOTTY;
return 0;
}