add vfprintf from Sys V.2;/usr/src/lib/libc/port/print/vfprintf.c
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 30 Mar 1988 04:46:42 +0000 (20:46 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 30 Mar 1988 04:46:42 +0000 (20:46 -0800)
SCCS-vsn: old/cpio/cpio.c 5.4

usr/src/old/cpio/cpio.c

index c18c606..eac1fac 100644 (file)
@@ -1485,3 +1485,28 @@ register unsigned        count;
 
        return  savedto;
 }
 
        return  savedto;
 }
+
+extern int _doprnt();
+
+/*VARARGS2*/
+int
+vfprintf(iop, format, ap)
+FILE *iop;
+char *format;
+va_list ap;
+{
+       register int count;
+
+       if (!(iop->_flag | _IOWRT)) {
+               /* if no write flag */
+               if (iop->_flag | _IORW) {
+                       /* if ok, cause read-write */
+                       iop->_flag |= _IOWRT;
+               } else {
+                       /* else error */
+                       return EOF;
+               }
+       }
+       count = _doprnt(format, ap, iop);
+       return(ferror(iop)? EOF: count);
+}