From 085fc4555abde267bd2f5fc7d2eb8bd98d8399f4 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 9 Apr 2025 15:16:55 -0600 Subject: [PATCH] termios: Do return EINVAL for bad action to tcsetattr() Set errno for bad actions in tsetattr to catch bad actions. Sponsored by: Netflix --- stand/kboot/libkboot/termios.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/kboot/libkboot/termios.c b/stand/kboot/libkboot/termios.c index ec62170a44c..cd25b252f73 100644 --- a/stand/kboot/libkboot/termios.c +++ b/stand/kboot/libkboot/termios.c @@ -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);