| 1402 | as usual and return false. Otherwise return true. */ |
| 1403 | |
| 1404 | static bool |
| 1405 | read_block (idx_t n, char *block, idx_t *n_bytes_in_buffer) |
| 1406 | { |
| 1407 | bool ok = true; |
| 1408 | |
| 1409 | affirm (0 < n && n <= bytes_per_block); |
| 1410 | |
| 1411 | *n_bytes_in_buffer = 0; |
| 1412 | |
| 1413 | while (in_stream != NULL) /* EOF. */ |
| 1414 | { |
| 1415 | idx_t n_needed = n - *n_bytes_in_buffer; |
| 1416 | idx_t n_read = fread (block + *n_bytes_in_buffer, |
| 1417 | 1, n_needed, in_stream); |
| 1418 | |
| 1419 | *n_bytes_in_buffer += n_read; |
| 1420 | |
| 1421 | if (n_read == n_needed) |
| 1422 | break; |
| 1423 | |
| 1424 | ok &= check_and_close (errno); |
| 1425 | |
| 1426 | ok &= open_next_file (); |
| 1427 | } |
| 1428 | |
| 1429 | return ok; |
| 1430 | } |
| 1431 | |
| 1432 | /* Return the least common multiple of the sizes associated |
| 1433 | with the format specs. */ |
no test coverage detected