Module Name:    src
Committed By:   christos
Date:           Fri Aug 28 22:02:24 UTC 2020

Modified Files:
        src/lib/libc/stdio: vdprintf.c

Log Message:
Allow vdprintf to work on non-blocking non-regular files (Rob Newberry)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/stdio/vdprintf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/stdio/vdprintf.c
diff -u src/lib/libc/stdio/vdprintf.c:1.5 src/lib/libc/stdio/vdprintf.c:1.6
--- src/lib/libc/stdio/vdprintf.c:1.5	Tue Jan 10 12:45:12 2017
+++ src/lib/libc/stdio/vdprintf.c	Fri Aug 28 18:02:24 2020
@@ -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 c
 		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;

Reply via email to