termios: Do return EINVAL for bad action to tcsetattr()

Set errno for bad actions in tsetattr to catch bad actions.

Sponsored by:		Netflix
This commit is contained in:
Warner Losh 2025-04-09 15:16:55 -06:00
parent b2bd8c9a1d
commit 085fc4555a

View file

@ -22,7 +22,7 @@ int
host_tcsetattr(int fd, int act, const struct host_termios *tio)
{
if (act < 0 || act > 2) {
// errno = EINVAL; /* XXX ?? */
errno = EINVAL; /* XXX ?? */
return -1;
}
return host_ioctl(fd, HOST_TCSETS+act, (uintptr_t)tio);