Just like bio_out, bio_err needs the linebuffer filter on VMS
[openssl.git] / apps / apps.c
index b4307427a5d613e70bdbfb8d24977c82f05f3d2d..128f387593289bd4910acba36cc117ad0c728c1c 100644 (file)
@@ -2486,6 +2486,17 @@ BIO *dup_bio_out(int format)
     return b;
 }
 
+BIO *dup_bio_err(int format)
+{
+    BIO *b = BIO_new_fp(stderr,
+                        BIO_NOCLOSE | (istext(format) ? BIO_FP_TEXT : 0));
+#ifdef OPENSSL_SYS_VMS
+    if (istext(format))
+        b = BIO_push(BIO_new(BIO_f_linebuffer()), b);
+#endif
+    return b;
+}
+
 void unbuffer(FILE *fp)
 {
     setbuf(fp, NULL);