| 123 | } |
| 124 | |
| 125 | static FILE* robust_fopen(const char* path, const char* mode, int max_tries = 10) { |
| 126 | int tries = 0; |
| 127 | FILE* file = my_fopen(path, mode); |
| 128 | while (file == NULL && tries < max_tries) { |
| 129 | file = my_fopen(path, mode); |
| 130 | if (file == NULL) { |
| 131 | tries++; |
| 132 | BusyWaitMilliseconds(50); |
| 133 | } |
| 134 | } |
| 135 | return file; |
| 136 | } |
| 137 | |
| 138 | static std::string ReadScriptFile(const Path& path) { |
| 139 | int max_tries = 10; |
no test coverage detected