Ejemplo n.º 1
0
int main(int argc, char* argv[]) {
	LDEBUG("address of notification procedure entry: %p",
			ChildThread::processNotification)

	// send a notification to let the parent know where the notification instruction is
	ChildProcess::notifyParent(ParentNotification_Startup,
			(long) ChildThread::processNotification);

	// start the child process
	ChildProcess child;
	int ret;
	try {
		ret = child.main(argc, argv);
	} catch (Exception &e) {
		fprintf(stderr, "Exception occurred: %s\n", e.get_message().c_str());
		e.print(2);
		exit(1);
	} catch (Exception *e) {
		fprintf(stderr, "Exception occurred: %s\n", e->get_message().c_str());
		e->print(2);
		exit(1);
	} catch (string &s) {
		fprintf(stderr, "Exception occurred: %s\n", s.c_str());
		exit(1);
	} catch (const char* str) {
		fprintf(stderr, "Exception occurred: %s\n", str);
		exit(1);
	} catch (...) {
		fprintf(stderr, "Exception occurred \n");
		exit(1);
	}

	LDEBUG("Exit value: %i", ret)
	exit(ret);
}