LP#1461625: ensure srfsh doesn't close STDOUT prematurely
authorGalen Charlton <gmc@esilibrary.com>
Wed, 3 Jun 2015 17:42:06 +0000 (17:42 +0000)
committerMike Rylander <mrylander@gmail.com>
Wed, 24 Jun 2015 13:44:24 +0000 (09:44 -0400)
commit14eefb26b9e93e9a9a3bff275bc0a5efadf2cc8e
tree834ca786359bf1c6aff28360497eaa4b56080f62
parentd6b1c12ee60f70601bba44426e03ad851513dbfd
LP#1461625: ensure srfsh doesn't close STDOUT prematurely

Ensure that when running srfsh in non-interactive mode
that reads commands directly from a file, (i.e.,
"srfsh script.srfsh" or as a shebang script), it does
not close STDOUT after handling the first request.

To test
-------
[1] Create a srfsh script containing:

    request opensrf.math opensrf.system.echo "foo"
    request opensrf.math opensrf.system.echo "bar"

[2] Run "srfsh script.srfsh". Note that only the
    results of the first echo request are output.
[3] Apply the patch and recompile, then run
    "srfsh script.srfsh" again.  This time, the
    output of both requests is displayed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
src/srfsh/srfsh.c