mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-17 14:30:15 +00:00
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
This commit is contained in:
parent
9fde44ac10
commit
811d602842
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user