Skip to content

Commit

Permalink
tools lib api fs: Use str_error_r()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnaldo Carvalho de Melo committed Jul 12, 2016
1 parent c3cec9e commit b31e3e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions tools/lib/api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion tools/lib/api/fs/tracing_path.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit b31e3e3

Please sign in to comment.