diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-07-18 11:25:51 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-07-18 13:48:05 +0000 |
commit | 1d980cc63e8dc30dbd4ce4b4faaf04e420a90882 (patch) | |
tree | abfd1d5f3d1a3ceda4f77ec1a547500a44f9c7ee /vespalib | |
parent | 840f24c5af8ad7027037d688baed37ad8d388980 (diff) |
GC unused OpenExisting
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/tests/fastos/file_test.cpp | 2 | ||||
-rw-r--r-- | vespalib/src/vespa/fastos/file.cpp | 23 | ||||
-rw-r--r-- | vespalib/src/vespa/fastos/file.h | 13 |
3 files changed, 1 insertions, 37 deletions
diff --git a/vespalib/src/tests/fastos/file_test.cpp b/vespalib/src/tests/fastos/file_test.cpp index ecb35df5d26..f0a859f0bfb 100644 --- a/vespalib/src/tests/fastos/file_test.cpp +++ b/vespalib/src/tests/fastos/file_test.cpp @@ -171,7 +171,7 @@ TEST(FileTest, WriteOnlyTest) { TEST(FileTest, ReadWriteTest) { Generated guard; auto myFile = std::make_unique<FastOS_File>(rwFilename.c_str()); - ASSERT_FALSE(myFile->OpenExisting()); + ASSERT_FALSE(myFile->OpenReadOnlyExisting()); ASSERT_TRUE(myFile->OpenReadWrite()); ASSERT_EQ(myFile->GetSize(), 0); char dummyData[6] = "Dummy"; diff --git a/vespalib/src/vespa/fastos/file.cpp b/vespalib/src/vespa/fastos/file.cpp index 44c8ee8025e..19a000296de 100644 --- a/vespalib/src/vespa/fastos/file.cpp +++ b/vespalib/src/vespa/fastos/file.cpp @@ -221,29 +221,6 @@ FastOS_FileInterface::OpenReadWrite(const char *filename) bool -FastOS_FileInterface::OpenExisting(bool abortIfNotExist, - const char *filename) -{ - bool rc = Open(FASTOS_FILE_OPEN_READ | - FASTOS_FILE_OPEN_WRITE | - FASTOS_FILE_OPEN_EXISTING, - filename); - - if (abortIfNotExist && (!rc)) { - std::string errorString = - FastOS_FileInterface::getLastErrorString(); - fprintf(stderr, - "Cannot open %s: %s\n", - filename, - errorString.c_str()); - abort(); - } - - return rc; -} - - -bool FastOS_FileInterface::OpenReadOnlyExisting(bool abortIfNotExist, const char *filename) { diff --git a/vespalib/src/vespa/fastos/file.h b/vespalib/src/vespa/fastos/file.h index 8f155fe54a5..4e49951277f 100644 --- a/vespalib/src/vespa/fastos/file.h +++ b/vespalib/src/vespa/fastos/file.h @@ -145,19 +145,6 @@ public: bool OpenReadWrite(const char *filename=nullptr); /** - * Open a file for read/write access. This method fails if the file does - * not already exist. - * @param abortIfNotExist Abort the program if the file does not exist. - * @param filename You may optionally specify a filename here. This - * will replace the currently associated filename - * (if any) set using either the constructor, - * or a previous call to - * @ref Open(). - * @return Boolean success/failure - */ - bool OpenExisting(bool abortIfNotExist=false, const char *filename=nullptr); - - /** * Open a file for read access. This method fails if the file does * not already exist. * @param abortIfNotExist Abort the program if the file does not exist. |