int main(int argc, char* argv[]) { OS_X11 os; Error err = Main::setup(argv[0],argc-1,&argv[1]); if (err!=OK) return 255; if (Main::start()) os.run(); // it is actually the OS that decides how to run Main::cleanup(); return os.get_exit_code(); }
int main(int argc, char *argv[]) { OS_X11 os; char *cwd = (char *)malloc(PATH_MAX); getcwd(cwd, PATH_MAX); Error err = Main::setup(argv[0], argc - 1, &argv[1]); if (err != OK) return 255; if (Main::start()) os.run(); // it is actually the OS that decides how to run Main::cleanup(); chdir(cwd); free(cwd); return os.get_exit_code(); }