Ejemplo n.º 1
0
void
CommandLineUserInterface::Run()
{
	// Wait for the Show() semaphore to be released.
	status_t error;
	do {
		error = acquire_sem(fShowSemaphore);
	} while (error == B_INTERRUPTED);

	if (error != B_OK)
		return;

	if (!fSaveReport) {
		_InputLoop();
		// Release the Show() semaphore to signal Terminate().
		release_sem(fShowSemaphore);
	} else {
		ArgumentVector args;
		char buffer[256];
		const char* parseErrorLocation;
		if (_ReportTargetThreadStopNeeded()) {
			snprintf(buffer, sizeof(buffer), "stop %" B_PRId32,
				fReportTargetThread);
			args.Parse(buffer, &parseErrorLocation);
			_ExecuteCommand(args.ArgumentCount(), args.Arguments());
		} else
			_SubmitSaveReport();
	}
}
Ejemplo n.º 2
0
void
CommandLineUserInterface::Run()
{
	// Wait for the Show() semaphore to be released.
	status_t error;
	do {
		error = acquire_sem(fShowSemaphore);
	} while (error == B_INTERRUPTED);

	if (error != B_OK)
		return;

	_InputLoop();

	// Release the Show() semaphore to signal Terminate().
	release_sem(fShowSemaphore);
}