Skip to content

Commit

Permalink
Made GlViewer work on linux
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bkcabral authored and facebook-github-bot committed Mar 9, 2020
1 parent d0d18b1 commit 05371c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/mesh_stream/AsyncFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ struct AsyncFile {

void readBegin(PendingRead& pending, const std::vector<Segment>& 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);
Expand Down

0 comments on commit 05371c2

Please sign in to comment.