diff options
Diffstat (limited to 'src/input/plugins/FileInputPlugin.cxx')
-rw-r--r-- | src/input/plugins/FileInputPlugin.cxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/input/plugins/FileInputPlugin.cxx b/src/input/plugins/FileInputPlugin.cxx index 49dc3df7e..932db2150 100644 --- a/src/input/plugins/FileInputPlugin.cxx +++ b/src/input/plugins/FileInputPlugin.cxx @@ -33,18 +33,16 @@ static constexpr Domain file_domain("file"); -struct FileInputStream { - InputStream base; - +struct FileInputStream final : public InputStream { int fd; - FileInputStream(const char *path, int _fd, off_t size, - Mutex &mutex, Cond &cond) - :base(input_plugin_file, path, mutex, cond), + FileInputStream(const char *path, int _fd, off_t _size, + Mutex &_mutex, Cond &_cond) + :InputStream(input_plugin_file, path, _mutex, _cond), fd(_fd) { - base.size = size; - base.seekable = true; - base.SetReady(); + size = _size; + seekable = true; + SetReady(); } ~FileInputStream() { @@ -88,9 +86,7 @@ input_file_open(const char *filename, posix_fadvise(fd, (off_t)0, st.st_size, POSIX_FADV_SEQUENTIAL); #endif - FileInputStream *fis = new FileInputStream(filename, fd, st.st_size, - mutex, cond); - return &fis->base; + return new FileInputStream(filename, fd, st.st_size, mutex, cond); } static bool |