linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf buildid-list: Fix return value of perf buildid-list -k
@ 2015-12-02 18:27 Michael Petlan
  2015-12-06 18:51 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Petlan @ 2015-12-02 18:27 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-perf-users@vger.kernel.org

The buildid string length is returned by perf buildid-list -k command.
Since a non-zero return value means an error, perf buildid-list -k cmd
should return 0 when successful instead.

Before:

	# perf buildid-list -k
	39356d74e96e02346fe0ec1f3f162b6c522bac62
	# echo $?
	41

After:

	# perf buildid-list -k
	39356d74e96e02346fe0ec1f3f162b6c522bac62
	# echo $?
	0

Signed-off-by: Michael Petlan <mpetlan@redhat.com>
---
 tools/perf/builtin-buildid-list.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c
index 918b4de..6419f57 100644
--- a/tools/perf/builtin-buildid-list.c
+++ b/tools/perf/builtin-buildid-list.c
@@ -110,7 +110,7 @@ int cmd_buildid_list(int argc, const char **argv,
 	setup_pager();
 
 	if (show_kernel)
-		return sysfs__fprintf_build_id(stdout);
+		return !(sysfs__fprintf_build_id(stdout) > 0);
 
 	return perf_session__list_build_ids(force, with_hits);
 }

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-06 18:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-02 18:27 [PATCH] perf buildid-list: Fix return value of perf buildid-list -k Michael Petlan
2015-12-06 18:51 ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).