Luc, I have to post
an updated patch because I overlooked one case in my original test – the output
redirection was left enabled after the sial command completed. It caused
subsequent sial commands to be redirected (undesirable). This update saves
and restores the original fp at the end of a redirection. Sorry... - Robert - Generated By:
Teradata Corporation (Mon Nov 12 21:19:08 PST 2007) extensions.c
| 12 +++++++++++++++++++++++++++++++++++++++++++++++++ extensions/sial.c
| 13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files
changed, 25 insertions(+), 0 deletions(-) Index:
crash-4.0-4.8/extensions/sial.c =================================================================== --- crash-4.0-4.8-orig/extensions/sial.c
2007-11-12 21:15:36.000000000 -0800 +++
crash-4.0-4.8/extensions/sial.c 2007-11-12 21:19:03.000000000 -0800 @@ -638,7
+638,20 @@ run_callback(void) { extern char
*crash_global_cmd(); +extern FILE
*crash_cmd_filep(); + + FILE
*fp, +
*ofp = NULL; + + if ((fp
= crash_cmd_filep()) != NULL) { +
ofp = sial_getofile(); +
sial_setofile(fp); + } +
sial_cmd(crash_global_cmd(), args, argcnt); + if (ofp)
{ +
sial_setofile(ofp); + } } Index:
crash-4.0-4.8/extensions.c =================================================================== ---
crash-4.0-4.8-orig/extensions.c 2007-11-12 21:15:36.000000000 -0800 +++
crash-4.0-4.8/extensions.c 2007-11-12 21:15:57.000000000 -0800 @@ -374,3
+374,15 @@ { return
pc->cmd_table; } + +FILE * +crash_cmd_filep(void) +{ + if
(pc->redirect & REDIRECT_TO_FILE) { +
return pc->ofile; + } else
if (pc->redirect & REDIRECT_TO_PIPE) { +
return pc->pipe; + } else { +
return NULL; + } +} From:
crash-utility-bounces@xxxxxxxxxx [mailto:crash-utility-bounces@xxxxxxxxxx] On Behalf Of Chouinard, Luc Very useful thing to have. Looks good. Dave can you
queue it?
|
-- Crash-utility mailing list Crash-utility@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/crash-utility