<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.59">
<TITLE>RE: [Crash-utility] sial output redirection</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Very useful thing to have. Looks good. Dave can you queue it?<BR>
<BR>
   Luc<BR>
<BR>
-----Original Message-----<BR>
From: crash-utility-bounces@redhat.com on behalf of Denman, Robert<BR>
Sent: Mon 11/12/2007 6:43 PM<BR>
To: crash-utility@redhat.com<BR>
Subject: [Crash-utility] sial output redirection<BR>
<BR>
Luc,<BR>
The following patch will allow the output of SIAL commands to be<BR>
redirected to a file or pipe.  I did not handle all cases supported by<BR>
crash (e.g. multi-pipes), only simple output redirection.  Would you<BR>
please consider this change or something like it in the next release?<BR>
Thanks.<BR>
<BR>
- Robert -<BR>
<BR>
Generated By: Teradata Corporation  (Mon Nov 12 15:29:56 PST 2007)<BR>
<BR>
 extensions.c      |   12<BR>
++++++++++++++++++++++++++++++++++++++++++++++++++++++<BR>
 extensions/sial.c |    7 +++++++++++++++++++++++++++++++<BR>
 2 files changed, 19 insertions(+), 0 deletions(-)<BR>
<BR>
Index: crash-4.0-4.8/extensions/sial.c<BR>
===================================================================<BR>
--- crash-4.0-4.8-orig/extensions/sial.c        2007-10-30<BR>
08:51:54.000000000 -0<BR>
700<BR>
+++ crash-4.0-4.8/extensions/sial.c     2007-11-12 15:28:55.000000000<BR>
-0800<BR>
@@ -638,6 +638,13 @@<BR>
 run_callback(void)<BR>
 {<BR>
 extern char *crash_global_cmd();<BR>
+extern FILE *crash_cmd_filep();<BR>
+<BR>
+       FILE *fp;<BR>
+<BR>
+       if ((fp = crash_cmd_filep()) != NULL) {<BR>
+               sial_setofile(fp);<BR>
+       }<BR>
        sial_cmd(crash_global_cmd(), args, argcnt);<BR>
 }<BR>
<BR>
Index: crash-4.0-4.8/extensions.c<BR>
===================================================================<BR>
--- crash-4.0-4.8-orig/extensions.c     2007-10-30 08:51:54.000000000<BR>
-0700<BR>
+++ crash-4.0-4.8/extensions.c  2007-11-12 15:27:21.000000000 -0800<BR>
@@ -374,3 +374,15 @@<BR>
 {<BR>
        return pc->cmd_table;<BR>
 }<BR>
+<BR>
+FILE *<BR>
+crash_cmd_filep(void)<BR>
+{<BR>
+       if (pc->redirect & REDIRECT_TO_FILE) {<BR>
+               return pc->ofile;<BR>
+       } else if (pc->redirect & REDIRECT_TO_PIPE) {<BR>
+               return pc->pipe;<BR>
+       } else {<BR>
+               return NULL;<BR>
+       }<BR>
+}<BR>
<BR>
<BR>
</FONT>
</P>

<br clear=all> Confidentiality Notice
This e-mail (including any attachments) is intended only for the recipients named above. It may contain confidential or privileged information and should not be read, copied or otherwise used by any other person. If you are not a named recipient, please notify the sender of that fact and delete the e-mail from your system.
</BODY>
</HTML>