From 01a234bfb1e033aa8e0de6003391d0337e180c5f Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 6 Feb 2022 01:10:30 +0800 Subject: [PATCH] pipe: Add DEV_PIPE_VFS_PATH to specify the pipe location and put into /var/pipe by default like other pseudo device Signed-off-by: Xiang Xiao --- drivers/pipes/Kconfig | 6 ++++++ drivers/pipes/pipe.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/pipes/Kconfig b/drivers/pipes/Kconfig index 9b47a9e2fce..4bec13dd240 100644 --- a/drivers/pipes/Kconfig +++ b/drivers/pipes/Kconfig @@ -34,4 +34,10 @@ config DEV_FIFO_SIZE Sets the default size of the FIFO ringbuffer in bytes. A value of zero disables FIFO support. +config DEV_PIPE_VFS_PATH + string "Path to the pipe device" + default "/var/pipe" + ---help--- + The path to where pipe device will exist in the VFS namespace. + endif # PIPES diff --git a/drivers/pipes/pipe.c b/drivers/pipes/pipe.c index a77ce796db3..14d0529297c 100644 --- a/drivers/pipes/pipe.c +++ b/drivers/pipes/pipe.c @@ -174,7 +174,7 @@ static int pipe_register(size_t bufsize, int flags, /* Create a pathname to the pipe device */ - snprintf(devname, namesize, "/dev/pipe%d", pipeno); + snprintf(devname, namesize, CONFIG_DEV_PIPE_VFS_PATH"/%d", pipeno); /* Check if the pipe device has already been created */