lkml.org 
[lkml]   [2010]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [tip:perf/core] perf probe: Don't always consider EOF as an error when listing source code
Date
tip-bot for Franck Bui-Huu <fbuihuu@gmail.com> writes:


[...]

> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index 3ba9c53..80cc0bc 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -287,7 +287,7 @@ static int get_real_path(const char *raw_path, const char *comp_dir,
> #define LINEBUF_SIZE 256
> #define NR_ADDITIONAL_LINES 2
>
> -static int show_one_line(FILE *fp, int l, bool skip, bool show_num)
> +static int __show_one_line(FILE *fp, int l, bool skip, bool show_num)
> {
> char buf[LINEBUF_SIZE];
> const char *color = show_num ? "" : PERF_COLOR_BLUE;
> @@ -306,16 +306,30 @@ static int show_one_line(FILE *fp, int l, bool skip, bool show_num)
>
> } while (strchr(buf, '\n') == NULL);
>
> - return 0;
> + return 1;
> error:
> - if (feof(fp))
> + if (ferror(fp)) {
> pr_warning("Source file is shorter than expected.\n");
> - else
> - pr_warning("File read error: %s\n", strerror(errno));
> + return -1;

Argh, something wrong here.

The warning left here, is the wrong one, I should have left the other
one.

Sorry for the mistake.

Should I send a patch to fix that ?
--
Franck


\
 
 \ /
  Last update: 2010-12-22 14:17    [W:0.102 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site