|  |  | @@ -29,6 +29,10 @@ | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | #include <cstring> | 
		
	
		
			
			|  |  |  | #include <cerrno> | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | /// Dummy used to suppressed warnings about unused values. | 
		
	
		
			
			|  |  |  | int iDummy; | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | #endif | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | #include <stdexcept> | 
		
	
	
		
			
			|  |  | @@ -276,7 +280,7 @@ namespace CodeDweller { | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | // Send message to parent. | 
		
	
		
			
			|  |  |  | errMsg = "Error redirecting stdin in the child:  " + getErrorText(); | 
		
	
		
			
			|  |  |  | ::write(childStdOutPipe[1], errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | iDummy = ::write(childStdOutPipe[1], errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | exit(-1); | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  |  | 
		
	
	
		
			
			|  |  | @@ -286,7 +290,7 @@ namespace CodeDweller { | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | // Send message to parent. | 
		
	
		
			
			|  |  |  | errMsg = "Error redirecting stdout in the child:  " + getErrorText(); | 
		
	
		
			
			|  |  |  | ::write(childStdOutPipe[1], errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | iDummy = ::write(childStdOutPipe[1], errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | exit(-1); | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  |  | 
		
	
	
		
			
			|  |  | @@ -299,7 +303,7 @@ namespace CodeDweller { | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | // Send message to parent. | 
		
	
		
			
			|  |  |  | errMsg = "Error closing the pipes in the child:  " + getErrorText(); | 
		
	
		
			
			|  |  |  | ::write(STDOUT_FILENO, errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | iDummy = ::write(STDOUT_FILENO, errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | exit(-1); | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | } | 
		
	
	
		
			
			|  |  | @@ -320,7 +324,7 @@ namespace CodeDweller { | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | // Send message to parent. | 
		
	
		
			
			|  |  |  | errMsg = "Error from exec:  " + getErrorText(); | 
		
	
		
			
			|  |  |  | ::write(STDOUT_FILENO, errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | iDummy = ::write(STDOUT_FILENO, errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | exit(-1); | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | } | 
		
	
	
		
			
			|  |  | @@ -1195,7 +1199,7 @@ namespace CodeDweller { | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | // Send message to parent. | 
		
	
		
			
			|  |  |  | errMsg = "Error redirecting stdin in the child:  " + getErrorText(); | 
		
	
		
			
			|  |  |  | ::write(childStdOutPipe[1], errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | iDummy = ::write(childStdOutPipe[1], errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | exit(-1); | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  |  | 
		
	
	
		
			
			|  |  | @@ -1205,7 +1209,7 @@ namespace CodeDweller { | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | // Send message to parent. | 
		
	
		
			
			|  |  |  | errMsg = "Error redirecting stdout in the child:  " + getErrorText(); | 
		
	
		
			
			|  |  |  | ::write(childStdOutPipe[1], errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | iDummy = ::write(childStdOutPipe[1], errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | exit(-1); | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  |  | 
		
	
	
		
			
			|  |  | @@ -1214,7 +1218,7 @@ namespace CodeDweller { | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | // Send message to parent. | 
		
	
		
			
			|  |  |  | errMsg = "Error redirecting stderr in the child:  " + getErrorText(); | 
		
	
		
			
			|  |  |  | ::write(childStdOutPipe[1], errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | iDummy = ::write(childStdOutPipe[1], errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | exit(-1); | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  |  | 
		
	
	
		
			
			|  |  | @@ -1227,7 +1231,7 @@ namespace CodeDweller { | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | // Send message to parent. | 
		
	
		
			
			|  |  |  | errMsg = "Error closing the pipes in the child:  " + getErrorText(); | 
		
	
		
			
			|  |  |  | ::write(STDOUT_FILENO, errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | iDummy = ::write(STDOUT_FILENO, errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | exit(-1); | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | } | 
		
	
	
		
			
			|  |  | @@ -1250,7 +1254,7 @@ namespace CodeDweller { | 
		
	
		
			
			|  |  |  | errMsg = "Error (from exec) running the command \""; | 
		
	
		
			
			|  |  |  | errMsg += execvArgv[0]; | 
		
	
		
			
			|  |  |  | errMsg += ":  " + getErrorText(); | 
		
	
		
			
			|  |  |  | ::write(STDOUT_FILENO, errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | iDummy = ::write(STDOUT_FILENO, errMsg.data(), errMsg.size()); | 
		
	
		
			
			|  |  |  | exit(-1); | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | } |