perf strlist: load() should return a negative errno

To match what its users return.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-jntpe2lwg1fxn1bku7uccan0@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 3d5d68aa
...@@ -72,7 +72,7 @@ int strlist__load(struct strlist *slist, const char *filename) ...@@ -72,7 +72,7 @@ int strlist__load(struct strlist *slist, const char *filename)
FILE *fp = fopen(filename, "r"); FILE *fp = fopen(filename, "r");
if (fp == NULL) if (fp == NULL)
return errno; return -errno;
while (fgets(entry, sizeof(entry), fp) != NULL) { while (fgets(entry, sizeof(entry), fp) != NULL) {
const size_t len = strlen(entry); const size_t len = strlen(entry);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment