diff options
Diffstat (limited to 'v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c')
-rw-r--r-- | v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c b/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c index ff9b3b5c1..4834c786a 100644 --- a/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c +++ b/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c @@ -172,7 +172,7 @@ static void v4lcontrol_init_flags(struct v4lcontrol_data *data) struct v4lcontrol_data *v4lcontrol_create(int fd) { int shm_fd; - int init = 0; + int i, init = 0; char *s, shm_name[256]; struct v4l2_capability cap; @@ -184,6 +184,11 @@ struct v4lcontrol_data *v4lcontrol_create(int fd) syscall(SYS_ioctl, fd, VIDIOC_QUERYCAP, &cap); snprintf(shm_name, 256, "/%s:%s", cap.bus_info, cap.card); + /* / is not allowed inside shm names */ + for (i = 1; shm_name[i]; i++) + if (shm_name[i] == '/') + shm_name[i] = '-'; + /* Open the shared memory object identified by shm_name */ if ((shm_fd = shm_open(shm_name, (O_CREAT | O_EXCL | O_RDWR), (S_IREAD | S_IWRITE))) >= 0) |