From 8adbefb2b796781c059ca3124840dc9353709c37 Mon Sep 17 00:00:00 2001 From: James Turner Date: Fri, 26 Feb 2016 21:21:00 +0200 Subject: [PATCH] Fix Windows compile of HTTP repo tests. --- simgear/io/test_repository.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/simgear/io/test_repository.cxx b/simgear/io/test_repository.cxx index 371dee91..6ea61c10 100644 --- a/simgear/io/test_repository.cxx +++ b/simgear/io/test_repository.cxx @@ -19,6 +19,7 @@ #include #include #include +#include using namespace simgear; @@ -284,8 +285,11 @@ std::string test_computeHashForPath(const SGPath& p) sha1_init(&info); char* buf = static_cast(alloca(1024 * 1024)); size_t readLen; - int fd = ::open(p.c_str(), O_RDONLY); - while ((readLen = ::read(fd, buf, 1024 * 1024)) > 0) { + + SGFile f(p.str()); + f.open(SG_IO_IN); + + while ((readLen = f.read(buf, 1024 * 1024)) > 0) { sha1_write(&info, buf, readLen); } -- 2.39.5