]> git.baikalelectronics.ru Git - kernel.git/commit
perf target: Simplify handling of strerror_r return
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 23 Mar 2015 21:23:02 +0000 (18:23 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 24 Mar 2015 15:08:30 +0000 (12:08 -0300)
commita265bf56726aa32b7121f6f0ad71ceb293184cd1
treed067492224b46395beccdf48c1d75fd8552dad50
parentf888b4d8f11eedc82c828440264bacbd6e832129
perf target: Simplify handling of strerror_r return

To deal with forwarding the strerror_r (GNU) return we need to check if
the returned value is the buffer we passed or maybe some constant
(unknown error), simplify that action by using scnprintf, that will do
all the buflen size checks, trimming if needed.

Acked-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-d0ik6i5gjew56j0qphql28ou@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/target.c