| 57 | } |
| 58 | |
| 59 | static bool activation_test_write(const char *path, const char *contents) { |
| 60 | FILE *file = cbm_fopen(path, "wb"); |
| 61 | if (!file) { |
| 62 | return false; |
| 63 | } |
| 64 | size_t length = strlen(contents); |
| 65 | bool ok = fwrite(contents, 1, length, file) == length; |
| 66 | ok = fclose(file) == 0 && ok; |
| 67 | #ifndef _WIN32 |
| 68 | ok = chmod(path, 0700) == 0 && ok; |
| 69 | #endif |
| 70 | return ok; |
| 71 | } |
| 72 | |
| 73 | static bool activation_test_exists(const char *path) { |
| 74 | struct stat status; |
no test coverage detected