this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[coredump] Add Support For macOS Path

+15
+15
src/hosttools/src/coredump/main.cpp
··· 252 252 if (fd < 0 && filename_length >= cprm->prefix_length && strncmp(filename, cprm->prefix, cprm->prefix_length) == 0) { 253 253 std::filesystem::path temp_filename = std::filesystem::path() / LIBEXEC_PATH / &filename[cprm->prefix_length]; 254 254 fd = open(temp_filename.c_str(), O_RDONLY); 255 + 256 + // Sometimes the absolute path may actually be the macOS path 257 + } else if (fd < 0 && filename[0] == '/') { 258 + const char* relative_macos_path = &filename[1]; // Convert the absolute path into a relative path 259 + std::filesystem::path temp_filename; 260 + 261 + // Let's see if the file exists in the upper layer 262 + temp_filename = std::filesystem::path(cprm->prefix) / relative_macos_path; 263 + fd = open(temp_filename.c_str(), O_RDONLY); 264 + 265 + // Otherwise, check the lower layer 266 + if (fd < 0) { 267 + temp_filename = std::filesystem::path(LIBEXEC_PATH) / relative_macos_path; 268 + fd = open(temp_filename.c_str(), O_RDONLY); 269 + } 255 270 } 256 271 257 272 return fd;