aboutsummaryrefslogtreecommitdiffstats
path: root/fastos
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-01-26 16:27:02 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-01-26 16:27:02 +0000
commitd0021d07f986c820a901c32794e52bac9243e9a5 (patch)
treef645377684f668967843ea312ddb559a18f9eaa7 /fastos
parenta7093177040bd5e9296572d39a15d1c06edd7fb2 (diff)
Add [[nodiscard]] to Close() and Sync()
Diffstat (limited to 'fastos')
-rw-r--r--fastos/src/vespa/fastos/file.h4
-rw-r--r--fastos/src/vespa/fastos/unix_file.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/fastos/src/vespa/fastos/file.h b/fastos/src/vespa/fastos/file.h
index a352c6281a3..aa8f495d064 100644
--- a/fastos/src/vespa/fastos/file.h
+++ b/fastos/src/vespa/fastos/file.h
@@ -309,7 +309,7 @@ public:
* already is closed.
* @return Boolean success/failure
*/
- virtual bool Close() = 0;
+ [[nodiscard]] virtual bool Close() = 0;
/**
* Is the file currently opened?
@@ -439,7 +439,7 @@ public:
/**
* Force completion of pending disk writes (flush cache).
*/
- virtual bool Sync() = 0;
+ [[nodiscard]] virtual bool Sync() = 0;
/**
* Are we in some kind of file read mode?
diff --git a/fastos/src/vespa/fastos/unix_file.h b/fastos/src/vespa/fastos/unix_file.h
index c0a908a5948..891b5e0dba7 100644
--- a/fastos/src/vespa/fastos/unix_file.h
+++ b/fastos/src/vespa/fastos/unix_file.h
@@ -61,7 +61,7 @@ public:
ssize_t Read(void *buffer, size_t len) override;
ssize_t Write2(const void *buffer, size_t len) override;
bool Open(unsigned int openFlags, const char *filename) override;
- bool Close() override;
+ [[nodiscard]] bool Close() override;
bool IsOpened() const override { return _filedes >= 0; }
void enableMemoryMap(int flags) override {
@@ -87,7 +87,7 @@ public:
int64_t GetSize() override;
time_t GetModificationTime() override;
bool Delete() override;
- bool Sync() override;
+ [[nodiscard]] bool Sync() override;
bool SetSize(int64_t newSize) override;
void dropFromCache() const override;