Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools lib api fs: Use str_error_r()

To make it portable to non-glibc systems, that follow the XSI variant
instead of the GNU specific one that gets in place when _GNU_SOURCE is
defined.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-mixgnh3iyajuqogn2opsocdy@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+3 -1
+1
tools/lib/api/Makefile
··· 26 26 27 27 CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 28 28 CFLAGS += -I$(srctree)/tools/lib/api 29 + CFLAGS += -I$(srctree)/tools/include 29 30 30 31 RM = rm -f 31 32
+2 -1
tools/lib/api/fs/tracing_path.c
··· 5 5 #include <stdio.h> 6 6 #include <stdlib.h> 7 7 #include <string.h> 8 + #include <linux/string.h> 8 9 #include <errno.h> 9 10 #include <unistd.h> 10 11 #include "fs.h" ··· 119 118 } 120 119 break; 121 120 default: 122 - snprintf(buf, size, "%s", strerror_r(err, sbuf, sizeof(sbuf))); 121 + snprintf(buf, size, "%s", str_error_r(err, sbuf, sizeof(sbuf))); 123 122 break; 124 123 } 125 124