Bug 1519355 - [Wayland] Produce better error message when mozilla::widget::WaylandShmPool::CreateTemporaryFile() fails, r=jhorak

Differential Revision: https://phabricator.services.mozilla.com/D16297

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Martin Stransky 2019-01-11 15:15:10 +00:00
parent 05862a940f
commit d704841235

View File

@ -168,6 +168,9 @@ int WaylandShmPool::CreateTemporaryFile(int aSize) {
} while (ret == EINTR);
if (ret != 0) {
close(fd);
MOZ_CRASH_UNSAFE_PRINTF(
"posix_fallocate() fails on %s size %d error code %d\n", filename,
aSize, ret);
}
#else
do {
@ -175,9 +178,10 @@ int WaylandShmPool::CreateTemporaryFile(int aSize) {
} while (ret < 0 && errno == EINTR);
if (ret < 0) {
close(fd);
MOZ_CRASH_UNSAFE_PRINTF("ftruncate() fails on %s size %d error code %d\n",
filename, aSize, ret);
}
#endif
MOZ_RELEASE_ASSERT(ret == 0, "Mapping file allocation failed.");
return fd;
}