* Resolves the executable path by querying Darwin application stack. * * Returns 0 on success, -1 on failure. */
| 136 | * Returns 0 on success, -1 on failure. |
| 137 | */ |
| 138 | static int git_get_exec_path_darwin(struct strbuf *buf) |
| 139 | { |
| 140 | char path[PATH_MAX]; |
| 141 | uint32_t size = sizeof(path); |
| 142 | if (!_NSGetExecutablePath(path, &size)) { |
| 143 | trace_printf( |
| 144 | "trace: resolved executable path from Darwin stack: %s\n", |
| 145 | path); |
| 146 | strbuf_addstr(buf, path); |
| 147 | return 0; |
| 148 | } |
| 149 | return -1; |
| 150 | } |
| 151 | #endif /* HAVE_NS_GET_EXECUTABLE_PATH */ |
| 152 | |
| 153 | #ifdef HAVE_ZOS_GET_EXECUTABLE_PATH |
no test coverage detected