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>
fprintf(less, "Request Time in seconds: %.6f\n", end - start );
fputs("------------------------------------\n", less);
- pclose(less);
+ if(!is_from_script) pclose(less);
osrf_app_session_request_finish( session, req_id );