mirror of
https://github.com/phatina/simple-mtpfs
synced 2024-12-18 04:44:57 +00:00
commit
9c763c0d59
@ -394,7 +394,10 @@ bool SMTPFileSystem::exec()
|
||||
}
|
||||
m_device.disconnect();
|
||||
|
||||
m_tmp_files_pool.removeTmpDir();
|
||||
if (!m_tmp_files_pool.removeTmpDir()) {
|
||||
logerr("Can not remove a temporary directory.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -460,8 +463,12 @@ int SMTPFileSystem::mknod(const char *path, mode_t mode, dev_t dev)
|
||||
if (rval < 0)
|
||||
return -errno;
|
||||
|
||||
m_device.filePush(tmp_path, std::string(path));
|
||||
rval = m_device.filePush(tmp_path, std::string(path));
|
||||
::unlink(tmp_path.c_str());
|
||||
|
||||
if (rval != 0)
|
||||
return rval;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -575,7 +582,10 @@ int SMTPFileSystem::create(const char *path, mode_t mode, fuse_file_info *file_i
|
||||
|
||||
file_info->fh = rval;
|
||||
m_tmp_files_pool.addFile(TypeTmpFile(std::string(path), tmp_path, rval, true));
|
||||
m_device.filePush(tmp_path, std::string(path));
|
||||
rval = m_device.filePush(tmp_path, std::string(path));
|
||||
|
||||
if (rval != 0)
|
||||
return rval;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -58,8 +58,9 @@ std::string TmpFilesPool::makeTmpPath(const std::string &path_device) const
|
||||
|
||||
bool TmpFilesPool::createTmpDir()
|
||||
{
|
||||
removeTmpDir();
|
||||
return smtpfs_create_dir(m_tmp_dir);
|
||||
if (removeTmpDir())
|
||||
return smtpfs_create_dir(m_tmp_dir);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TmpFilesPool::removeTmpDir()
|
||||
|
Loading…
Reference in New Issue
Block a user