LP#1461625: ensure srfsh doesn't close STDOUT prematurely user/gmcharlt/lp1461625_srfsh_multiline_script_output
authorGalen Charlton <gmc@esilibrary.com>
Wed, 3 Jun 2015 17:42:06 +0000 (17:42 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 3 Jun 2015 17:42:06 +0000 (17:42 +0000)
commit4860f7d26036e8133204a688c175f7c96a490cd3
tree96f8670f9625d8606de2eab271a8cbb4bd4bc09e
parent42f14c919d82abbf5927775b933ff8c5d4070d2e
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>
src/srfsh/srfsh.c