CVSROOT: /cvs Module name: src Changes by: mill...@cvs.openbsd.org 2023/10/06 10:41:02
Modified files: lib/libc/stdio : fvwrite.c putc.c vfprintf.c vfwprintf.c wbuf.c wsetup.c Log message: __swsetup: set error flag and errno on error. Previously, we set errno to EBADF if the cantwrite() macro (which calls __swsetup()) returns true for POSIX compliance. However, we neglected to also set the error flag, __SERR. Rather than set the error flag in all callers of cantwrite(), set both errno and the error flag in __swsetup(). This matches what FreeBSD does and makes it possible to choose a proper errno value for the second error condition in __swsetup(). OK deraadt@