summaryrefslogtreecommitdiff
path: root/apps/errstr.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2000-09-20 13:55:50 +0000
committerRichard Levitte <levitte@openssl.org>2000-09-20 13:55:50 +0000
commit645749ef98612340b11c4bf2ba856e1fa469912b (patch)
tree3a93d71b7f63b5b01f085c38211ce82af0778125 /apps/errstr.c
parent9a0c0d3f7441515452caff3380b235bb15d33a5e (diff)
downloadopenssl-new-645749ef98612340b11c4bf2ba856e1fa469912b.tar.gz
On VMS, stdout may very well lead to a file that is written to in a
record-oriented fashion. That means that every write() will write a separate record, which will be read separately by the programs trying to read from it. This can be very confusing. The solution is to put a BIO filter in the way that will buffer text until a linefeed is reached, and then write everything a line at a time, so every record written will be an actual line, not chunks of lines and not (usually doesn't happen, but I've seen it once) several lines in one record. Voila, BIO_f_linebuffer() is born. Since we're so close to release time, I'm making this VMS-only for now, just to make sure no code is needlessly broken by this. After the release, this BIO method will be enabled on all other platforms as well.
Diffstat (limited to 'apps/errstr.c')
-rw-r--r--apps/errstr.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/errstr.c b/apps/errstr.c
index 2c62046476..e392328f93 100644
--- a/apps/errstr.c
+++ b/apps/errstr.c
@@ -91,12 +91,18 @@ int MAIN(int argc, char **argv)
out=BIO_new(BIO_s_file());
if ((out != NULL) && BIO_set_fp(out,stdout,BIO_NOCLOSE))
{
+#ifdef VMS
+ {
+ BIO *tmpbio = BIO_new(BIO_f_linebuffer());
+ out = BIO_push(tmpbio, out);
+ }
+#endif
lh_node_stats_bio((LHASH *)ERR_get_string_table(),out);
lh_stats_bio((LHASH *)ERR_get_string_table(),out);
lh_node_usage_stats_bio((LHASH *)
ERR_get_string_table(),out);
}
- if (out != NULL) BIO_free(out);
+ if (out != NULL) BIO_free_all(out);
argc--;
argv++;
}