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
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;
}
}