| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include <gyoji-misc/input-source-file.hpp> | ||
| 2 | #include <errno.h> | ||
| 3 | #include <unistd.h> | ||
| 4 | |||
| 5 | using namespace Gyoji::misc; | ||
| 6 | |||
| 7 | 290 | InputSourceFile::InputSourceFile(int _fd) | |
| 8 | 290 | : fd(_fd) | |
| 9 | 290 | {} | |
| 10 | 290 | InputSourceFile::~InputSourceFile() | |
| 11 | 290 | {} | |
| 12 | |||
| 13 | 826 | void InputSourceFile::read(char *buf, int &result, int max_size) | |
| 14 | { | ||
| 15 | 826 | errno = 0; | |
| 16 | 826 | result = (int) ::read(fd, buf, (size_t) max_size); | |
| 17 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 826 times.
|
826 | if (result == -1) { |
| 18 | ✗ | if( errno != EINTR) { | |
| 19 | ✗ | fprintf(stderr, "Fatal error reading input buffer %d\n", errno); | |
| 20 | } | ||
| 21 | } | ||
| 22 | 826 | errno = 0; | |
| 23 | 826 | } | |
| 24 |