| 126 | } |
| 127 | |
| 128 | std::string our_exe_path () |
| 129 | { |
| 130 | if (argv0[0] == '/') { |
| 131 | // argv[0] starts with / => it's an absolute path |
| 132 | return argv0; |
| 133 | } else if (std::strchr(argv0, '/')) { |
| 134 | // argv[0] contains / => it a relative path that should be resolved |
| 135 | char* resolved_path_p = realpath(argv0, nullptr); |
| 136 | std::string resolved_path(resolved_path_p); |
| 137 | free(resolved_path_p); |
| 138 | return resolved_path; |
| 139 | } else { |
| 140 | // argv[0] is just a bare filename => not much we can do |
| 141 | return argv0; |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | int exit_status (int wait_status) |
| 146 | { |
no outgoing calls
no test coverage detected