| 1778 | } |
| 1779 | |
| 1780 | static bool activation_native_read(activation_native_file_t file, void *buffer, size_t capacity, |
| 1781 | size_t *read_out) { |
| 1782 | #ifdef _WIN32 |
| 1783 | DWORD amount = 0; |
| 1784 | DWORD request = capacity > (size_t)UINT32_MAX ? UINT32_MAX : (DWORD)capacity; |
| 1785 | if (!ReadFile(file, buffer, request, &amount, NULL)) { |
| 1786 | return false; |
| 1787 | } |
| 1788 | *read_out = (size_t)amount; |
| 1789 | return true; |
| 1790 | #else |
| 1791 | ssize_t result; |
| 1792 | do { |
| 1793 | result = read(file, buffer, capacity); |
| 1794 | } while (result < 0 && errno == EINTR); |
| 1795 | if (result < 0) { |
| 1796 | return false; |
| 1797 | } |
| 1798 | *read_out = (size_t)result; |
| 1799 | return true; |
| 1800 | #endif |
| 1801 | } |
| 1802 | |
| 1803 | cbm_activation_transaction_status_t cbm_activation_transaction_stage_file( |
| 1804 | const char *target_path, const char *candidate_path, |
no test coverage detected