| 254 | Return the number of bytes read. */ |
| 255 | |
| 256 | static idx_t |
| 257 | read_input (char *dest, idx_t max_n_bytes) |
| 258 | { |
| 259 | if (max_n_bytes == 0) |
| 260 | return 0; |
| 261 | |
| 262 | ptrdiff_t bytes_read = safe_read (STDIN_FILENO, dest, max_n_bytes); |
| 263 | |
| 264 | if (bytes_read == 0) |
| 265 | have_read_eof = true; |
| 266 | |
| 267 | if (bytes_read < 0) |
| 268 | { |
| 269 | error (0, errno, _("read error")); |
| 270 | cleanup_fatal (); |
| 271 | } |
| 272 | |
| 273 | return bytes_read; |
| 274 | } |
| 275 | |
| 276 | /* Initialize existing line record P. */ |
| 277 |
no test coverage detected