MCPcopy Create free account
hub / github.com/ElementsProject/elements / SaveError

Function SaveError

src/leveldb/db/c.cc:145–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143};
144
145static bool SaveError(char** errptr, const Status& s) {
146 assert(errptr != nullptr);
147 if (s.ok()) {
148 return false;
149 } else if (*errptr == nullptr) {
150 *errptr = strdup(s.ToString().c_str());
151 } else {
152 // TODO(sanjay): Merge with existing error?
153 free(*errptr);
154 *errptr = strdup(s.ToString().c_str());
155 }
156 return true;
157}
158
159static char* CopyString(const std::string& str) {
160 char* result = reinterpret_cast<char*>(malloc(sizeof(char) * str.size()));

Callers 9

SetDataIteratorMethod · 0.85
leveldb_openFunction · 0.85
leveldb_putFunction · 0.85
leveldb_deleteFunction · 0.85
leveldb_writeFunction · 0.85
leveldb_getFunction · 0.85
leveldb_destroy_dbFunction · 0.85
leveldb_repair_dbFunction · 0.85
leveldb_iter_get_errorFunction · 0.85

Calls 1

ToStringMethod · 0.45

Tested by

no test coverage detected