[Crash-utility] bug in cmdline.c

Dave Anderson anderson at redhat.com
Thu Feb 16 15:59:45 UTC 2012



----- Original Message -----
> In exec_input_file():
> 
> 1375                 if (!(pc->flags & SILENT)) {
> 1376                         fprintf(fp, "%s%s", pc->prompt, buf);
> 
> This "fp" variable needs to be "stdout".
> The prompting and echoing of input commands needs to go there,
> not whereever "fp" is currently pointing (crash command output).

I'm not sure I agree...
 
> $ diff -u *~ cmdline.c
> --- cmdline.c~  2012-02-03 11:22:33.000000000 -0800
> +++ cmdline.c   2012-02-15 16:51:07.209524248 -0800
> @@ -1372,10 +1372,8 @@
>                  if (!(argcnt = parse_line(pc->command_line, args)))
>                          continue;
> 
> -                if (!(pc->flags & SILENT)) {
> -                        fprintf(fp, "%s%s", pc->prompt, buf);
> -                        fflush(fp);
> -                }
> +                if (!(pc->flags & SILENT))
> +                        printf("%s%s", pc->prompt, buf);
> 
>                   exec_command();
>           }

Can you show an example of the problem that you're trying
to handle?  

Also, printf() is never used by the crash utility. (well, except
by some dead va_server.c code, some dead remote.c debug code,
and a couple places in s390dbf.c which I don't control...)

Dave




More information about the Crash-utility mailing list