sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-10-08 00:42:41 +00:00
parent a959d2beea
commit 3252c81e6b
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
29 changed files with 283 additions and 186 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: putc.c,v 1.13 2015/08/31 02:53:57 guenther Exp $ */
/* $OpenBSD: putc.c,v 1.14 2023/10/06 16:41:02 millert Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@ -32,7 +32,6 @@
*/
#include <stdio.h>
#include <errno.h>
#include "local.h"
/*
@ -43,10 +42,8 @@
int
putc_unlocked(int c, FILE *fp)
{
if (cantwrite(fp)) {
errno = EBADF;
if (cantwrite(fp))
return (EOF);
}
_SET_ORIENTATION(fp, -1);
return (__sputc(c, fp));
}