lkml.org 
[lkml]   [2010]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [tip:perf/core] perf probe: Don't always consider EOF as an error when listing source code
Date
Arnaldo Carvalho de Melo <acme@infradead.org> writes:

> Em Wed, Dec 22, 2010 at 02:14:43PM +0100, Franck Bui-Huu escreveu:
>> tip-bot for Franck Bui-Huu <fbuihuu@gmail.com> writes:
>> > 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 ?
>
> Please.
>

[PATCH] perf-probe: Fix wrong warning in __show_one_line() if read(1) errors happen

From: Franck Bui-Huu <fbuihuu@gmail.com>

This was introduced by commit fde52dbd7f71934aba4e150f3d1d51e826a08850.

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
---
tools/perf/util/probe-event.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 469ad35..10ad1ad 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -319,7 +319,7 @@ static int __show_one_line(FILE *fp, int l, bool skip, bool show_num)
return 1;
error:
if (ferror(fp)) {
- pr_warning("Source file is shorter than expected.\n");
+ pr_warning("File read error: %s\n", strerror(errno));
return -1;
}
return 0;
--
1.7.3.2


--
Franck


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