From 2b5be19c1d23a205df88b816bbdfc1efe755550d Mon Sep 17 00:00:00 2001 From: Jimmy Ohn Date: Mon, 6 Jan 2020 14:08:47 +0900 Subject: [PATCH] Add missing return value for MTPDevice filePush function --- src/simple-mtpfs-fuse.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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; }