From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932174AbcELKZx (ORCPT ); Thu, 12 May 2016 06:25:53 -0400 Received: from terminus.zytor.com ([198.137.202.10]:37860 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932109AbcELKZv (ORCPT ); Thu, 12 May 2016 06:25:51 -0400 Date: Thu, 12 May 2016 03:25:13 -0700 From: tip-bot for Masami Hiramatsu Message-ID: Cc: peterz@infradead.org, linux-kernel@vger.kernel.org, mhiramat@kernel.org, acme@redhat.com, mingo@kernel.org, ananth@linux.vnet.ibm.com, brendan.d.gregg@gmail.com, namhyung@kernel.org, tglx@linutronix.de, hemant@linux.vnet.ibm.com, hpa@zytor.com Reply-To: tglx@linutronix.de, namhyung@kernel.org, brendan.d.gregg@gmail.com, ananth@linux.vnet.ibm.com, hpa@zytor.com, hemant@linux.vnet.ibm.com, mingo@kernel.org, acme@redhat.com, mhiramat@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org In-Reply-To: <20160511135127.23943.40644.stgit@devbox> References: <20160511135127.23943.40644.stgit@devbox> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Fix lsdir to set errno correctly Git-Commit-ID: 357a54f32a065835d3e6a08b07a91a57e52f32c7 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 357a54f32a065835d3e6a08b07a91a57e52f32c7 Gitweb: http://git.kernel.org/tip/357a54f32a065835d3e6a08b07a91a57e52f32c7 Author: Masami Hiramatsu AuthorDate: Wed, 11 May 2016 22:51:27 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 11 May 2016 13:06:05 -0300 perf tools: Fix lsdir to set errno correctly Fix lsdir() to set correct positive error number (ENOMEM). Since "errno" must have a positive error number instead of negative number, fix lsdir to set it correctly. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Brendan Gregg Cc: Hemant Kumar Cc: Namhyung Kim Cc: Peter Zijlstra Fixes: e1ce726e1db2 ("perf tools: Add lsdir() helper to read a directory") Link: http://lkml.kernel.org/r/20160511135127.23943.40644.stgit@devbox Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index 01c9433..eab077a 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c @@ -139,7 +139,7 @@ struct strlist *lsdir(const char *name, list = strlist__new(NULL, NULL); if (!list) { - errno = -ENOMEM; + errno = ENOMEM; goto out; }