diff options
author | Antoine Jacoutot <ajacoutot@gnome.org> | 2014-04-18 00:59:45 +0200 |
---|---|---|
committer | Antoine Jacoutot <ajacoutot@gnome.org> | 2014-04-18 18:20:34 +0200 |
commit | be9d1e0b3ba969c71db6e1b00be505bea425908b (patch) | |
tree | 45236322ff632d88a9058c542a5e83953a05ec57 /gdk/broadway | |
parent | 2e1d0df1eda8c29303f98746d0eef077f8ea996c (diff) | |
download | gtk+-be9d1e0b3ba969c71db6e1b00be505bea425908b.tar.gz |
broadway backend: allow building on OpenBSD
On OpenBSD shm_open(3) is part of libc and there is not librt, so add an
according check.
Check if we have posix_fallocate before using it.
https://bugzilla.gnome.org/show_bug.cgi?id=728272
Diffstat (limited to 'gdk/broadway')
-rw-r--r-- | gdk/broadway/Makefile.am | 6 | ||||
-rw-r--r-- | gdk/broadway/gdkbroadway-server.c | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/gdk/broadway/Makefile.am b/gdk/broadway/Makefile.am index af1fa9783c..0f190b3402 100644 --- a/gdk/broadway/Makefile.am +++ b/gdk/broadway/Makefile.am @@ -1,5 +1,6 @@ ## Process this file with automake to produce Makefile.in include $(top_srcdir)/Makefile.decl +NULL = libgdkincludedir = $(includedir)/gtk-3.0/gdk libgdkbroadwayincludedir = $(includedir)/gtk-3.0/gdk/broadway @@ -75,7 +76,8 @@ libgdk_broadway_la_SOURCES = \ if OS_UNIX libgdk_broadway_la_LIBADD = \ - -lrt + $(SHM_LIBS) \ + $(NULL) endif broadwayd_SOURCES = \ @@ -91,7 +93,7 @@ broadwayd_SOURCES = \ if OS_WIN32 broadwayd_LDADD = $(GDK_DEP_LIBS) -lws2_32 else -broadwayd_LDADD = $(GDK_DEP_LIBS) -lrt +broadwayd_LDADD = $(GDK_DEP_LIBS) @SHM_LIBS@ endif MAINTAINERCLEANFILES = $(broadway_built_sources) diff --git a/gdk/broadway/gdkbroadway-server.c b/gdk/broadway/gdkbroadway-server.c index 55ab58bfa7..dfbb19dc4f 100644 --- a/gdk/broadway/gdkbroadway-server.c +++ b/gdk/broadway/gdkbroadway-server.c @@ -540,12 +540,14 @@ map_named_shm (char *name, gsize size) res = ftruncate (fd, size); g_assert (res != -1); +#ifdef HAVE_POSIX_FALLOCATE res = posix_fallocate (fd, 0, size); if (res != 0) { 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); |