Skip to content

Commit

Permalink
fix code checker (#939)
Browse files Browse the repository at this point in the history
Signed-off-by: xianliang.li <[email protected]>
  • Loading branch information
foxspy authored Nov 13, 2024
1 parent e089204 commit 5935c1f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/io/file_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
#include <unistd.h>

#include <stdexcept>
#include <string>

namespace knowhere {
struct FileReader {
FileReader(const std::string& filename, bool auto_remove = false) {
fd_ = open(filename.data(), O_RDONLY);
fd_ = open(filename.c_str(), O_RDONLY);
if (fd_ < 0) {
throw std::runtime_error("Cannot open file");
}
Expand All @@ -27,7 +28,7 @@ struct FileReader {
lseek(fd_, 0, SEEK_SET);

if (auto_remove) {
unlink(filename.data());
unlink(filename.c_str());
}
}

Expand Down

0 comments on commit 5935c1f

Please sign in to comment.