tools lib api fs: Use str_error_r()
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: b31e3e3316a78e4a2cf23be8e0d47e5e5a025bde Gitweb: http://git.kernel.org/tip/b31e3e3316a78e4a2cf23be8e0d47e5e5a025bde Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Fri, 8 Jul 2016 15:26:50 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 12 Jul 2016 15:20:29 -0300
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 <[email protected]>
Cc David Ahern <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Wang Nan <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/lib/api/Makefile | 1 + tools/lib/api/fs/tracing_path.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
tools/lib/api/Makefile +1 -0
@@ -26,6 +26,7 @@ endif CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 CFLAGS += -I$(srctree)/tools/lib/api +CFLAGS += -I$(srctree)/tools/include RM = rm -f
tools/lib/api/fs/tracing_path.c +2 -1
@@ -5,6 +5,7 @@#include <stdio.h> #include <stdlib.h> #include <string.h> +#include <linux/string.h> #include <errno.h> #include <unistd.h> #include "fs.h"
@@ -118,7 +119,7 @@ static int strerror_open(int err, char *buf, size_t size, const char *filename) }break ;default : -snprintf (buf, size,"%s" ,strerror_r (err, sbuf,sizeof (sbuf))); +snprintf (buf, size,"%s" ,str_error_r (err, sbuf,sizeof (sbuf)));break ; }