diff --git a/src/simple-mtpfs-fuse.cpp b/src/simple-mtpfs-fuse.cpp index 9e5880b..f0de485 100644 --- a/src/simple-mtpfs-fuse.cpp +++ b/src/simple-mtpfs-fuse.cpp @@ -463,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; } @@ -578,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; }