diff options
-rw-r--r-- | backends/fs/chroot/chroot-fs.cpp | 2 | ||||
-rw-r--r-- | backends/fs/posix/posix-fs.cpp | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/backends/fs/chroot/chroot-fs.cpp b/backends/fs/chroot/chroot-fs.cpp index f5f7c84570..be6805bbd8 100644 --- a/backends/fs/chroot/chroot-fs.cpp +++ b/backends/fs/chroot/chroot-fs.cpp @@ -108,7 +108,7 @@ Common::WriteStream *ChRootFilesystemNode::createWriteStream() { return _realNode->createWriteStream(); } -bool ChRootFilesystemNode::create(bool isDirectory) { +bool ChRootFilesystemNode::create(bool /*isDir*/) { error("Not supported"); return false; } diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp index 8597158f4c..746ae6a5a0 100644 --- a/backends/fs/posix/posix-fs.cpp +++ b/backends/fs/posix/posix-fs.cpp @@ -253,10 +253,10 @@ Common::WriteStream *POSIXFilesystemNode::createWriteStream() { return StdioStream::makeFromPath(getPath(), true); } -bool POSIXFilesystemNode::create(bool isDirectory) { +bool POSIXFilesystemNode::create(bool isDir) { bool success; - if (isDirectory) { + if (isDir) { success = mkdir(_path.c_str(), 0755) == 0; } else { int fd = open(_path.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0755); @@ -270,12 +270,12 @@ bool POSIXFilesystemNode::create(bool isDirectory) { if (success) { setFlags(); if (_isValid) { - if (_isDirectory != isDirectory) warning("failed to create %s: got %s", isDirectory ? "directory" : "file", _isDirectory ? "directory" : "file"); - return _isDirectory == isDirectory; + if (_isDirectory != isDir) warning("failed to create %s: got %s", isDir ? "directory" : "file", _isDirectory ? "directory" : "file"); + return _isDirectory == isDir; } warning("POSIXFilesystemNode: %s() was a success, but stat indicates there is no such %s", - isDirectory ? "mkdir" : "creat", isDirectory ? "directory" : "file"); + isDir ? "mkdir" : "creat", isDir ? "directory" : "file"); return false; } |