path: root/tools/perf
diff options
authorMasami Hiramatsu <>2016-05-11 22:51:27 +0900
committerArnaldo Carvalho de Melo <>2016-05-11 13:06:05 -0300
commit357a54f32a065835d3e6a08b07a91a57e52f32c7 (patch)
tree12054878d264df42d02d4a44b60742d3ab0fdcb8 /tools/perf
parentf5cd95ea6082d389be3337bea16c65d4220614fc (diff)
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: Signed-off-by: Arnaldo Carvalho de Melo <>
Diffstat (limited to 'tools/perf')
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 01c9433de7ef..eab077ad6ca9 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;