From: Julien Isorce Date: Fri, 7 Oct 2016 14:08:37 +0000 (+0100) Subject: gstfdmemory: log with GST_INFO instead of GST_ERROR on permission denied X-Git-Tag: 1.19.3~511^2~2543 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b68d9bbe436d6d62b75572a563853d86783660e0;p=platform%2Fupstream%2Fgstreamer.git 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 --- diff --git a/gst-libs/gst/allocators/gstfdmemory.c b/gst-libs/gst/allocators/gstfdmemory.c index a15859a8a5..f09da9e4e7 100644 --- a/gst-libs/gst/allocators/gstfdmemory.c +++ b/gst-libs/gst/allocators/gstfdmemory.c @@ -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; } }