diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2016-12-01 16:14:45 -0800 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2016-12-01 16:14:45 -0800 |
commit | 605d701471c3ee84682b0c149e41142d7cea95e7 (patch) | |
tree | 7a6af0e78ee2202f510686e9a3561c28829b8a4b /src/leveldb/util/env_posix.cc | |
parent | dc6dee41f7cf2ba93fcd0fea7c157e4b2775d439 (diff) | |
parent | 634ad517037b319147816f1d112b066528e1724a (diff) |
Merge in LevelDB 1.19 changes
Diffstat (limited to 'src/leveldb/util/env_posix.cc')
-rw-r--r-- | src/leveldb/util/env_posix.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/leveldb/util/env_posix.cc b/src/leveldb/util/env_posix.cc index ba2667864a..e0fca52f46 100644 --- a/src/leveldb/util/env_posix.cc +++ b/src/leveldb/util/env_posix.cc @@ -351,6 +351,19 @@ class PosixEnv : public Env { return s; } + virtual Status NewAppendableFile(const std::string& fname, + WritableFile** result) { + Status s; + FILE* f = fopen(fname.c_str(), "a"); + if (f == NULL) { + *result = NULL; + s = IOError(fname, errno); + } else { + *result = new PosixWritableFile(fname, f); + } + return s; + } + virtual bool FileExists(const std::string& fname) { return access(fname.c_str(), F_OK) == 0; } |