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

Method TokenWrite

src/util/tokenpipe.cpp:38–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38int TokenPipeEnd::TokenWrite(uint8_t token)
39{
40 while (true) {
41 ssize_t result = write(m_fd, &token, 1);
42 if (result < 0) {
43 // Failure. It's possible that the write was interrupted by a signal,
44 // in that case retry.
45 if (errno != EINTR) {
46 return TS_ERR;
47 }
48 } else if (result == 0) {
49 return TS_EOS;
50 } else { // ==1
51 return 0;
52 }
53 }
54}
55
56int TokenPipeEnd::TokenRead()
57{

Callers 3

StartShutdownFunction · 0.80
fork_daemonFunction · 0.80
AppInitFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected