| 54 | } |
| 55 | |
| 56 | bool StdinReady() |
| 57 | { |
| 58 | if (!StdinTerminal()) { |
| 59 | return true; |
| 60 | } |
| 61 | #ifdef WIN32 |
| 62 | return false; |
| 63 | #else |
| 64 | struct pollfd fds; |
| 65 | fds.fd = 0; /* this is STDIN */ |
| 66 | fds.events = POLLIN; |
| 67 | return poll(&fds, 1, 0) == 1; |
| 68 | #endif |
| 69 | } |
| 70 | |
| 71 | NoechoInst::NoechoInst() { SetStdinEcho(false); } |
| 72 | NoechoInst::~NoechoInst() { SetStdinEcho(true); } |
no test coverage detected