From 8df223a1efe588e282efc825a2fa8e8b0e1bae08 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Fri, 16 Sep 2022 14:33:09 +0800 Subject: [PATCH] libc: Add LIBC prefix to MEM_FD_VFS_PATH Signed-off-by: Xiang Xiao --- libs/libc/misc/Kconfig | 2 +- libs/libc/misc/lib_memfd.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/libc/misc/Kconfig b/libs/libc/misc/Kconfig index 99b13f75fd..4a7635e533 100644 --- a/libs/libc/misc/Kconfig +++ b/libs/libc/misc/Kconfig @@ -62,7 +62,7 @@ config LIBC_ENVPATH Use the contents of the common environment variable to locate executable or library files. Default: n -config MEM_FD_VFS_PATH +config LIBC_MEM_FD_VFS_PATH string "Relative path to memfd storage" default "memfd" depends on FS_TMPFS diff --git a/libs/libc/misc/lib_memfd.c b/libs/libc/misc/lib_memfd.c index 1f05fe5ea8..8675d33e43 100644 --- a/libs/libc/misc/lib_memfd.c +++ b/libs/libc/misc/lib_memfd.c @@ -31,7 +31,8 @@ * Pre-processor Definitions ****************************************************************************/ -#define MEM_FD_VFS_PATH CONFIG_LIBC_TMPDIR "/" CONFIG_MEM_FD_VFS_PATH "/%s" +#define LIBC_MEM_FD_VFS_PATH \ + CONFIG_LIBC_TMPDIR "/" CONFIG_LIBC_MEM_FD_VFS_PATH "/%s" /**************************************************************************** * Public Functions @@ -42,7 +43,7 @@ int memfd_create(FAR const char *name, unsigned int flags) #ifdef CONFIG_FS_TMPFS char path[PATH_MAX]; - snprintf(path, sizeof(path), MEM_FD_VFS_PATH, name); + snprintf(path, sizeof(path), LIBC_MEM_FD_VFS_PATH, name); return open(path, O_RDWR | flags); #else set_errno(ENOSYS);