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

Method TokenRead

src/util/tokenpipe.cpp:56–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56int TokenPipeEnd::TokenRead()
57{
58 uint8_t token;
59 while (true) {
60 ssize_t result = read(m_fd, &token, 1);
61 if (result < 0) {
62 // Failure. Check if the read was interrupted by a signal,
63 // in that case retry.
64 if (errno != EINTR) {
65 return TS_ERR;
66 }
67 } else if (result == 0) {
68 return TS_EOS;
69 } else { // ==1
70 return token;
71 }
72 }
73 return token;
74}
75
76void TokenPipeEnd::Close()
77{

Callers 3

WaitForShutdownFunction · 0.80
fork_daemonFunction · 0.80
AppInitFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected