MCPcopy Create free account
hub / github.com/apache/brpc / save_bin

Method save_bin

src/butil/files/temp_file.cpp:136–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136int TempFile::save_bin(const void *buf, size_t count) {
137 if (_reopen_if_necessary() < 0) {
138 return -1;
139 }
140
141 const ssize_t len = temp_file_write_all(_fd, buf, count);
142
143 close(_fd);
144 _fd = -1;
145 if (len < 0) {
146 return -1;
147 } else if ((size_t)len != count) {
148 errno = ENOSPC;
149 return -1;
150 }
151 return 0;
152}
153
154} // namespace butil

Callers 2

TEST_FFunction · 0.80
TEST_FFunction · 0.80

Calls 1

temp_file_write_allFunction · 0.85

Tested by 2

TEST_FFunction · 0.64
TEST_FFunction · 0.64