mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-08 14:41:55 +00:00
added binary detection for sun
This commit is contained in:
@@ -2573,8 +2573,22 @@ char *uwsgi_get_binary_path(char *argvzero) {
|
||||
char *buf = uwsgi_malloc(uwsgi.page_size);
|
||||
uint32_t len = uwsgi.page_size;
|
||||
if (_NSGetExecutablePath(buf, &len) == 0) {
|
||||
return buf;
|
||||
// return only absolute path
|
||||
char *newbuf = realpath(buf, NULL);
|
||||
if (newbuf) {
|
||||
free(buf);
|
||||
return newbuf;
|
||||
}
|
||||
}
|
||||
free(buf);
|
||||
#elif defined(__sun__)
|
||||
char *buf = getexecname();
|
||||
if (buf) {
|
||||
// return only absolute path
|
||||
if (buf[0] == '/') {
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user