From 05371c25775132b71d27d6314a3de9951bf1b68b Mon Sep 17 00:00:00 2001 From: Brian Cabral Date: Mon, 9 Mar 2020 08:17:39 -0700 Subject: [PATCH] Made GlViewer work on linux Summary: Fixes a bug in the async read that made the linux version crash. There's probably a latent bug somewhere else. Reviewed By: aparrapo Differential Revision: D20319700 fbshipit-source-id: 52564b29c8f85ef23b586c03295c630bcc71af13 --- source/mesh_stream/AsyncFile.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/mesh_stream/AsyncFile.h b/source/mesh_stream/AsyncFile.h index 348971c..9ab081a 100644 --- a/source/mesh_stream/AsyncFile.h +++ b/source/mesh_stream/AsyncFile.h @@ -165,7 +165,8 @@ struct AsyncFile { void readBegin(PendingRead& pending, const std::vector& segments, uint64_t offset) const { -#ifdef __APPLE__ // apple doesn't support preadv +#if defined(__APPLE__) || defined(__linux__) + // apple doesn't support preadv and linux crashes pending = std::async(&AsyncFile::readSegments, this, segments, offset); #else // __APPLE__ pending = std::async(preadv, handle, segments.data(), segments.size(), offset);