diff options
Diffstat (limited to 'www/firefox-esr/files/patch-bug1618914')
-rw-r--r-- | www/firefox-esr/files/patch-bug1618914 | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/www/firefox-esr/files/patch-bug1618914 b/www/firefox-esr/files/patch-bug1618914 index 817d00032222..c52ac49018b2 100644 --- a/www/firefox-esr/files/patch-bug1618914 +++ b/www/firefox-esr/files/patch-bug1618914 @@ -1,10 +1,17 @@ -[Wayland] Fall back to ftruncate if posix_fallocate isn't supported by filesystem. +From cea8e6a01bb03bbe565c9bf5dd4f439f30ca953f Mon Sep 17 00:00:00 2001 +From: Jan Beich <jbeich@FreeBSD.org> +Date: Fri, 28 Feb 2020 16:49:38 +0000 +Subject: Bug 1618914 - [Wayland] Fall back to ftruncate if posix_fallocate isn't supported by filesystem. -diff --git widget/gtk/WindowSurfaceWayland.cpp widget/gtk/WindowSurfaceWayland.cpp -index 9a73326399bd5..9e42a7f1c5d18 100644 ---- widget/gtk/WindowSurfaceWayland.cpp -+++ widget/gtk/WindowSurfaceWayland.cpp -@@ -222,20 +222,21 @@ static int WaylandAllocateShmMemory(int aSize) { +diff --git widget/gtk/WaylandShmBuffer.cpp widget/gtk/WaylandShmBuffer.cpp +index 42eeedd3429ac..2a5c23d287413 100644 +--- widget/gtk/WaylandShmBuffer.cpp ++++ widget/gtk/WaylandShmBuffer.cpp +@@ -67,36 +67,37 @@ static int WaylandAllocateShmMemory(int aSize) { + return -1; + } + + int ret = 0; #ifdef HAVE_POSIX_FALLOCATE do { ret = posix_fallocate(fd, 0, aSize); @@ -13,8 +20,12 @@ index 9a73326399bd5..9e42a7f1c5d18 100644 + if (ret == 0) { + return fd; + } else if (ret != ENODEV && ret != EINVAL && ret != EOPNOTSUPP) { + NS_WARNING( + nsPrintfCString("posix_fallocate() fails to allocate shm memory: %s", + strerror(ret)) + .get()); close(fd); - MOZ_CRASH("posix_fallocate() fails to allocate shm memory"); + return -1; } -#else +#endif @@ -22,20 +33,18 @@ index 9a73326399bd5..9e42a7f1c5d18 100644 ret = ftruncate(fd, aSize); } while (ret < 0 && errno == EINTR); if (ret < 0) { + NS_WARNING(nsPrintfCString("ftruncate() fails to allocate shm memory: %s", + strerror(ret)) + .get()); close(fd); - MOZ_CRASH("ftruncate() fails to allocate shm memory"); + fd = -1; } -#endif return fd; } -@@ -265,8 +266,8 @@ bool WaylandShmPool::Resize(int aSize) { - #ifdef HAVE_POSIX_FALLOCATE - do { - errno = posix_fallocate(mShmPoolFd, 0, aSize); - } while (errno == EINTR); -- if (errno != 0) return false; -+ if (errno != 0 && errno != ENODEV && errno != EINVAL && errno != EOPNOTSUPP) return false; - #endif - wl_shm_pool_resize(mShmPool, aSize); + /* static */ + RefPtr<WaylandShmPool> WaylandShmPool::Create( + const RefPtr<nsWaylandDisplay>& aWaylandDisplay, int aSize) { + RefPtr<WaylandShmPool> shmPool = new WaylandShmPool(aSize); |