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:
@@ -95,7 +95,7 @@ static int verify_tty(const char *name) {
|
||||
return -errno;
|
||||
|
||||
if (!isatty_safe(fd))
|
||||
return -errno;
|
||||
return -ENOTTY;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user