Commits

Peter Hosey  committed 3f25cc5

Exit when the task terminates. Pass an exit status to indicate whether the task succeeded or failed.

  • Participants
  • Parent commits cbafe9e

Comments (0)

Files changed (1)

File PRHTaskTest/PRHTaskTest/main.m

 	task.arguments = [NSArray arrayWithObject:@"I am the very model of a modern Major-General"];
 	task.successfulTerminationBlock = ^(PRHTask *completedTask) {
 		NSLog(@"Completed task: %@ with exit status: %i", completedTask, completedTask.terminationStatus);
+		exit(EXIT_SUCCESS);
 	};
 	task.abnormalTerminationBlock = ^(PRHTask *completedTask) {
 		NSLog(@"Task exited abnormally: %@ with exit status: %i", completedTask, completedTask.terminationStatus);
+		exit(EXIT_FAILURE);
 	};
 	[task launch];