mirror of
https://github.com/phatina/simple-mtpfs
synced 2025-03-10 07:08:26 +00:00
rewrite SMTPFileSystem::open()
This commit is contained in:
parent
4bab7cddd3
commit
63035618f8
@ -596,13 +596,18 @@ int SMTPFileSystem::open(const char *path, struct fuse_file_info *file_info)
|
||||
|
||||
std::string tmp_file = m_tmp_files_pool.makeTmpPath(std::string(path));
|
||||
int rval = m_device.filePull(std::string(path), tmp_file);
|
||||
if (rval != 0)
|
||||
return rval;
|
||||
if (rval != 0) {
|
||||
errno = rval;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int fd = ::open(tmp_file.c_str(), file_info->flags);
|
||||
if (fd < 0)
|
||||
return -errno;
|
||||
return -1;
|
||||
|
||||
file_info->fh = fd;
|
||||
m_tmp_files_pool.addFile(TypeTmpFile(std::string(path), tmp_file, fd));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user