From 40297065838f1bf9ba7c110333379770cc402990 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Wed, 3 Jun 2020 11:25:07 +0800 Subject: [PATCH] libc: tmpfile shouldn't hardcode the folder to /tmp use P_tmpdir macro instead Signed-off-by: Xiang Xiao --- libs/libc/stdio/lib_tmpfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/libc/stdio/lib_tmpfile.c b/libs/libc/stdio/lib_tmpfile.c index 5c27de8927..1965c09c55 100644 --- a/libs/libc/stdio/lib_tmpfile.c +++ b/libs/libc/stdio/lib_tmpfile.c @@ -32,7 +32,7 @@ FAR FILE *tmpfile(void) { - char path[L_tmpnam] = "/tmp/XXXXXX.tmp"; + char path[L_tmpnam] = P_tmpdir "/XXXXXX.tmp"; FAR FILE *fp = NULL; int fd;