____________________________________________________________ Read a buffer's worth of data. (non-WIN_NT)
| 887 | // Read a buffer's worth of data. (non-WIN_NT) |
| 888 | // |
| 889 | static void os_read(int* cnt, UCHAR** ptr) |
| 890 | { |
| 891 | BurpGlobals* tdgbl = BurpGlobals::getSpecific(); |
| 892 | |
| 893 | fb_assert(tdgbl->master); |
| 894 | |
| 895 | for (;;) |
| 896 | { |
| 897 | tdgbl->mvol_io_cnt = read(tdgbl->file_desc, tdgbl->mvol_io_buffer, tdgbl->mvol_io_buffer_size); |
| 898 | tdgbl->mvol_io_ptr = tdgbl->mvol_io_buffer; |
| 899 | |
| 900 | if (tdgbl->mvol_io_cnt > 0) { |
| 901 | break; |
| 902 | } |
| 903 | |
| 904 | if (!tdgbl->mvol_io_cnt || errno == EIO) |
| 905 | { |
| 906 | tdgbl->file_desc = next_volume(tdgbl->file_desc, MODE_READ, false); |
| 907 | if (tdgbl->mvol_io_cnt > 0) |
| 908 | { |
| 909 | break; |
| 910 | } |
| 911 | } |
| 912 | else if (!SYSCALL_INTERRUPTED(errno)) |
| 913 | { |
| 914 | if (cnt) |
| 915 | { |
| 916 | BURP_error_redirect(0, 220); |
| 917 | // msg 220 Unexpected I/O error while reading from backup file |
| 918 | } |
| 919 | else |
| 920 | { |
| 921 | BURP_error_redirect(0, 50); |
| 922 | // msg 50 unexpected end of file on backup file |
| 923 | } |
| 924 | } |
| 925 | } |
| 926 | } |
| 927 | |
| 928 | |
| 929 | #else |
no test coverage detected