perf strlist: load() should return a negative errno
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 16 Jul 2015 14:08:34 +0000 (11:08 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 16 Jul 2015 14:08:34 +0000 (11:08 -0300)
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.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/strlist.c

index 71f9d102b96fc4aa9a94176151008083e275199f..68ae673f9fb64bcae32dd0f59e4384d8211fb86d 100644 (file)
@@ -72,7 +72,7 @@ int strlist__load(struct strlist *slist, const char *filename)
        FILE *fp = fopen(filename, "r");
 
        if (fp == NULL)
-               return errno;
+               return -errno;
 
        while (fgets(entry, sizeof(entry), fp) != NULL) {
                const size_t len = strlen(entry);