]> git.evergreen-ils.org Git - OpenSRF.git/commit
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:04 +0000 (09:44 -0400)
commit6f1daba1493011a8b01cd80d29a68976c24c7010
tree1b36ab179a2b211ce29bfecfc49ca8a28d89a969
parentcc1f6ee9349584f7ec7b6f16861805a43f7161d6
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