| 103 | } |
| 104 | |
| 105 | static void write_dump_path(int fd, const char* path) { |
| 106 | // We use the linux syscall support methods from chromium here as per the |
| 107 | // recommendation of the breakpad docs to avoid calling into other shared libraries. |
| 108 | const char msg[] = "Wrote minidump to "; |
| 109 | sys_write(fd, msg, sizeof(msg) / sizeof(msg[0]) - 1); |
| 110 | // We use breakpad's reimplementation of strlen to avoid calling into libc. |
| 111 | sys_write(fd, path, my_strlen(path)); |
| 112 | sys_write(fd, "\n", 1); |
| 113 | } |
| 114 | |
| 115 | /// Callback for breakpad. It is called by breakpad whenever a minidump file has been |
| 116 | /// written and should not be called directly. It logs the event before breakpad crashes |