Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1456106
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 03/17] perf target: str_error_r() always returns the buffer it receives |
| Date | 2016-08-04 03:00 +0200 |
| Message-ID | <s2faW-1z3-33@gated-at.bofh.it> (permalink) |
| References | <s2f1g-1tP-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
So no need for checking if it uses the strerror_r() GNU variant error
reporting mechanism, i.e. if it returns a pointer to a immutable string
internal to glibc.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: c8b5f2c96d1b ("tools: Introduce str_error_r()")
Link: http://lkml.kernel.org/n/tip-xr83cd4y4r3cn6tq6w4f59jb@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/target.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/tools/perf/util/target.c b/tools/perf/util/target.c
index 8cdcf4641c51..21c4d9b23c24 100644
--- a/tools/perf/util/target.c
+++ b/tools/perf/util/target.c
@@ -122,11 +122,7 @@ int target__strerror(struct target *target, int errnum,
BUG_ON(buflen == 0);
if (errnum >= 0) {
- const char *err = str_error_r(errnum, buf, buflen);
-
- if (err != buf)
- scnprintf(buf, buflen, "%s", err);
-
+ str_error_r(errnum, buf, buflen);
return 0;
}
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-04 03:00 +0200 [PATCH 09/17] tools lib: Add bitmap_alloc function Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-04 03:00 +0200 [PATCH 16/17] perf tests: objdump output can contain multi byte chunks Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-04 03:00 +0200 [PATCH 12/17] perf tests: Add test for bitmap_scnprintf function Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-04 03:00 +0200 [PATCH 01/17] perf evsel: Introduce constructor for cycles event Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-04 03:00 +0200 [PATCH 04/17] perf annotate: Rename symbol__annotate() to symbol__disassemble() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-04 03:00 +0200 [PATCH 10/17] tools lib: Add bitmap_scnprintf function Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-04 03:00 +0200 [PATCH 03/17] perf target: str_error_r() always returns the buffer it receives Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-04 03:00 +0200 [PATCH 05/17] perf annotate: Introduce strerror for handling symbol__disassemble() errors Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-04 03:00 +0200 Re: [GIT PULL 00/17] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-08-04 11:30 +0200
csiph-web