diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-03-06 18:08:27 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-03-06 18:08:27 +0300 |
commit | c7b2d6baf29cd2a248e2d8dc09f7916643845f97 (patch) | |
tree | 16ac981c403eb48baccaca10290b7d7bc1d03eab /src/fs/virtfs/virtfileprivate.cpp | |
parent | b1241b3e98f72b50f38dad602da3d3f4b4edc7bf (diff) | |
download | mv-c7b2d6baf29cd2a248e2d8dc09f7916643845f97.tar.gz mv-c7b2d6baf29cd2a248e2d8dc09f7916643845f97.tar.bz2 mv-c7b2d6baf29cd2a248e2d8dc09f7916643845f97.tar.xz mv-c7b2d6baf29cd2a248e2d8dc09f7916643845f97.zip |
Add support for standard library file api in virtfs.s20170306
Because posix file api broken in mingw.
Diffstat (limited to 'src/fs/virtfs/virtfileprivate.cpp')
-rw-r--r-- | src/fs/virtfs/virtfileprivate.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/fs/virtfs/virtfileprivate.cpp b/src/fs/virtfs/virtfileprivate.cpp index 459a17ca9..682992c68 100644 --- a/src/fs/virtfs/virtfileprivate.cpp +++ b/src/fs/virtfs/virtfileprivate.cpp @@ -30,11 +30,11 @@ VirtFilePrivate::VirtFilePrivate() : mBuf(nullptr), mPos(0U), mSize(0U), - mFd(-1) + mFd(FILEHDEFAULT) { } -VirtFilePrivate::VirtFilePrivate(const int fd) : +VirtFilePrivate::VirtFilePrivate(FILEHTYPE fd) : mBuf(nullptr), mPos(0U), mSize(0U), @@ -47,14 +47,14 @@ VirtFilePrivate::VirtFilePrivate(uint8_t *restrict const buf, mBuf(buf), mPos(0U), mSize(sz), - mFd(-1) + mFd(FILEHDEFAULT) { } VirtFilePrivate::~VirtFilePrivate() { - if (mFd != -1) - close(mFd); + if (mFd != FILEHDEFAULT) + FILECLOSE(mFd); if (mBuf) delete [] mBuf; } |