FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 02-16-2012, 01:11 PM
Bruce Korb
 
Default bug in cmdline.c

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).

$ 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();
}

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 02-16-2012, 02:59 PM
Dave Anderson
 
Default bug in cmdline.c

----- 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

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 

Thread Tools




All times are GMT. The time now is 01:44 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org