diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-02-23 01:06:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-02-23 01:06:11 +0300 |
commit | 2b6106c41f3959d4deb8efc58c9055de0339959e (patch) | |
tree | 2ae271cd59997d4fe128e0173c0224e28417b34b /src/fs/virtfileprivate.cpp | |
parent | 76667ef0fa911fc8bf37df72896645dbfbbc0763 (diff) | |
download | mv-2b6106c41f3959d4deb8efc58c9055de0339959e.tar.gz mv-2b6106c41f3959d4deb8efc58c9055de0339959e.tar.bz2 mv-2b6106c41f3959d4deb8efc58c9055de0339959e.tar.xz mv-2b6106c41f3959d4deb8efc58c9055de0339959e.zip |
Impliment basic VirtFsDir for virtual fs based on directories.
Api similar to VirtFs.
VirtFsDir unused for now.
Diffstat (limited to 'src/fs/virtfileprivate.cpp')
-rw-r--r-- | src/fs/virtfileprivate.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/fs/virtfileprivate.cpp b/src/fs/virtfileprivate.cpp index 6bd5d3b9a..1dcc6116c 100644 --- a/src/fs/virtfileprivate.cpp +++ b/src/fs/virtfileprivate.cpp @@ -20,15 +20,25 @@ #include "fs/virtfileprivate.h" +#include <unistd.h> + #include "debug.h" VirtFilePrivate::VirtFilePrivate() : - mFile(nullptr) + mFile(nullptr), + mFd(-1) +{ +} + +VirtFilePrivate::VirtFilePrivate(const int fd) : + mFile(nullptr), + mFd(fd) { } VirtFilePrivate::VirtFilePrivate(PHYSFS_file *const file) : - mFile(file) + mFile(file), + mFd(-1) { } @@ -39,4 +49,6 @@ VirtFilePrivate::~VirtFilePrivate() PHYSFS_close(mFile); mFile = nullptr; } + if (mFd != -1) + close(mFd); } |