MCPcopy Create free account
hub / github.com/ceph/ceph / read_from_fd

Function read_from_fd

src/test/test_subprocess.cc:35–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33#endif
34
35bool read_from_fd(int fd, std::string &out) {
36 out.clear();
37 char buf[1024];
38 ssize_t n = safe_read(fd, buf, sizeof(buf) - 1);
39 if (n < 0)
40 return false;
41 buf[n] = '\0';
42 out = buf;
43 return true;
44}
45
46TEST(SubProcess, True)
47{

Callers 1

TESTFunction · 0.85

Calls 2

safe_readFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected