[openssl.org #1787] [PATCH] speed -multi buffered output fix

2008-12-10 Thread Lutz Jaenicke via RT
Thanks, patch applied.

Best regards,
Lutz
__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   [EMAIL PROTECTED]


[openssl.org #1787] [PATCH] speed -multi buffered output fix

2008-11-18 Thread Artur Klauser via RT
Resent to request tracker.
OS: Linux
OpenSSL version: 0.9.8i

When running speed tests on multiple processes and using buffered output
(e.g. to a file),
   openssl speed rsa1024 -multi 8  result
the child processes inherit pending buffered output from the parent process,
which in turn they send back in the result pipe to the parent. This confuses
the parser in the parent process and causes warning messages of the form
   Don't understand line 'Forked child 6' from child 7
The patch below makes sure the stdout buffer is flushed before forking,
avoiding this problem.

--- apps/speed.c~   2008-11-17 18:32:57.276608000 -0800
+++ apps/speed.c2008-11-17 18:33:51.35277 -0800
@@ -2760,6 +2760,8 @@
   for(n=0 ; n  multi ; ++n)
   {
   pipe(fd);
+   // children should not inherit buffered I/O for stdout
+   fflush(stdout);
   if(fork())
   {
   close(fd[1]);

 -artur-

__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   [EMAIL PROTECTED]