diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-01-18 15:15:37 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-01-18 15:15:37 -0500 |
commit | 811d602842ac48e3435a5ba92824a4f3c35551a0 (patch) | |
tree | 80b918586d444d86db034b8d00e2aa4dc7ed5f9a | |
parent | 9fde44ac10eb164d7d18b5b9838f902ad5af4d20 (diff) | |
download | gtk+-811d602842ac48e3435a5ba92824a4f3c35551a0.tar.gz |
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
-rw-r--r-- | 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 904eb7e13d..9033e3e27b 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); |