summaryrefslogtreecommitdiffstats
path: root/tools/lib/api/fs
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo2016-07-08 20:26:50 +0200
committerArnaldo Carvalho de Melo2016-07-12 20:20:29 +0200
commitb31e3e3316a78e4a2cf23be8e0d47e5e5a025bde (patch)
treec8445fb4cc9ad733493458ce2cdb0d1bbb1e8cf5 /tools/lib/api/fs
parenttools lib traceevent: Use str_error_r() (diff)
downloadkernel-qcow2-linux-b31e3e3316a78e4a2cf23be8e0d47e5e5a025bde.tar.gz
kernel-qcow2-linux-b31e3e3316a78e4a2cf23be8e0d47e5e5a025bde.tar.xz
kernel-qcow2-linux-b31e3e3316a78e4a2cf23be8e0d47e5e5a025bde.zip
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>
Diffstat (limited to 'tools/lib/api/fs')
-rw-r--r--tools/lib/api/fs/tracing_path.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/lib/api/fs/tracing_path.c b/tools/lib/api/fs/tracing_path.c
index a26bb5ea8283..251b7c342a87 100644
--- a/tools/lib/api/fs/tracing_path.c
+++ b/tools/lib/api/fs/tracing_path.c
@@ -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;
}