diff options
| author | christos <christos@NetBSD.org> | 2020-08-28 22:02:24 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2020-08-28 22:02:24 +0000 |
| commit | 99bb02b08433655d450d1052c8a7f9bcb1f8a615 (patch) | |
| tree | 8cd63c58d0678d074742277ad6fff8864bfa356b /lib/libc/stdio | |
| parent | 03535e0eb6c13166f8df34dfa03090a795217794 (diff) | |
Allow vdprintf to work on non-blocking non-regular files (Rob Newberry)
Diffstat (limited to 'lib/libc/stdio')
| -rw-r--r-- | lib/libc/stdio/vdprintf.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/lib/libc/stdio/vdprintf.c b/lib/libc/stdio/vdprintf.c index e3650095bee..9f0303d4835 100644 --- a/lib/libc/stdio/vdprintf.c +++ b/lib/libc/stdio/vdprintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: vdprintf.c,v 1.5 2017/01/10 17:45:12 christos Exp $ */ +/* $NetBSD: vdprintf.c,v 1.6 2020/08/28 22:02:24 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -34,12 +34,11 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vdprintf.c,v 1.5 2017/01/10 17:45:12 christos Exp $"); +__RCSID("$NetBSD: vdprintf.c,v 1.6 2020/08/28 22:02:24 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" #include <sys/types.h> -#include <sys/stat.h> #include <assert.h> #include <errno.h> @@ -89,16 +88,6 @@ vdprintf_l(int fd, locale_t loc, const char * __restrict fmt, va_list ap) return EOF; } - if (fdflags & O_NONBLOCK) { - struct stat st; - if (fstat(fd, &st) == -1) - return -1; - if (!S_ISREG(st.st_mode)) { - errno = EFTYPE; - return EOF; - } - } - _FILEEXT_SETUP(&f, &fext); __sfpinit(&f); f._p = buf; |
