[gtk+/gtk-3-14] Make Broadway work on freebsd
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-14] Make Broadway work on freebsd
- Date: Sat, 31 Jan 2015 19:26:36 +0000 (UTC)
commit 6231082839f3be6a7201401f12fb62a455f9fdc0
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jan 18 15:15:37 2015 -0500
Make Broadway work on freebsd
It seems that posix_fallocate gives an ENODEV error when
called on an fd opened with shm_open on freebsd. Fix up
the error check to only trigger if we get ENOSPC.
https://bugzilla.gnome.org/show_bug.cgi?id=742980
gdk/broadway/gdkbroadway-server.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdk/broadway/gdkbroadway-server.c b/gdk/broadway/gdkbroadway-server.c
index 642e65d..ecb0ea4 100644
--- a/gdk/broadway/gdkbroadway-server.c
+++ b/gdk/broadway/gdkbroadway-server.c
@@ -544,13 +544,13 @@ map_named_shm (char *name, gsize size)
#ifdef HAVE_POSIX_FALLOCATE
res = posix_fallocate (fd, 0, size);
- if (res != 0)
+ if (res != 0 && errno == ENOSPC)
{
shm_unlink (name);
g_error ("Not enough shared memory for window surface");
}
#endif
-
+
ptr = mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
(void) close(fd);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]