ui-macos: call the main binary MacOS/Sshuttle.

That way we can 'killall Sshuttle' and so on, and it looks right in the
process list.
This commit is contained in:
Avery Pennarun
2011-01-22 16:35:31 -08:00
parent 522bc23854
commit d4ccd30c24
5 changed files with 15 additions and 9 deletions

View File

@ -7,8 +7,17 @@
* goes wrong if your interpreter is /usr/bin/python.
*/
#include <Python.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char **argv)
{
return Py_Main(argc, argv);
}
char *path = strdup(argv[0]), *cptr;
char *args[] = {argv[0], "../Resources/main.py", NULL};
cptr = strrchr(path, '/');
if (cptr)
*cptr = 0;
chdir(path);
free(path);
return Py_Main(2, args);
}