mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 12:32:29 +00:00
gstfdmemory: log with GST_INFO instead of GST_ERROR on permission denied
For example mmap can fail with EACCES if the the fd has been open with read only mode. And mapping the memory might be the only way to check that. So no need to print out an error. Ex: ioctl(dev, DRM_IOCTL_PRIME_HANDLE_TO_FD, flags & ~DRM_RDWR) https://bugzilla.gnome.org/show_bug.cgi?id=765600
This commit is contained in:
parent
7e14875458
commit
b68d9bbe43
1 changed files with 13 additions and 2 deletions
|
@ -110,9 +110,20 @@ gst_fd_mem_map (GstMemory * gmem, gsize maxsize, GstMapFlags flags)
|
|||
|
||||
mem->data = mmap (0, gmem->maxsize, prot, flags, mem->fd, 0);
|
||||
if (mem->data == MAP_FAILED) {
|
||||
GstDebugLevel level;
|
||||
mem->data = NULL;
|
||||
GST_ERROR ("%p: fd %d: mmap failed: %s", mem, mem->fd,
|
||||
g_strerror (errno));
|
||||
|
||||
switch (errno) {
|
||||
case EACCES:
|
||||
level = GST_LEVEL_INFO;
|
||||
break;
|
||||
default:
|
||||
level = GST_LEVEL_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, level, NULL,
|
||||
"%p: fd %d: mmap failed: %s", mem, mem->fd, g_strerror (errno));
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue