MCPcopy Index your code
hub / github.com/git/git / git_get_exec_path_darwin

Function git_get_exec_path_darwin

exec-cmd.c:138–150  ·  view source on GitHub ↗

* Resolves the executable path by querying Darwin application stack. * * Returns 0 on success, -1 on failure. */

Source from the content-addressed store, hash-verified

136 * Returns 0 on success, -1 on failure.
137 */
138static 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

Callers 1

exec-cmd.cFile · 0.85

Calls 1

strbuf_addstrFunction · 0.85

Tested by

no test coverage detected