Skip to content

Commit

Permalink
perf tools: Fix lsdir to set errno correctly
Browse files Browse the repository at this point in the history
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 <mhiramat@kernel.org>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Fixes: e1ce726 ("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 <acme@redhat.com>
mhiramat authored and acmel committed May 11, 2016
1 parent f5cd95e commit 357a54f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/perf/util/util.c
Original file line number Diff line number Diff line change
@@ -139,7 +139,7 @@ struct strlist *lsdir(const char *name,

list = strlist__new(NULL, NULL);
if (!list) {
errno = -ENOMEM;
errno = ENOMEM;
goto out;
}

0 comments on commit 357a54f

Please sign in to comment.