'Record process termination and cancel the timeout call if it is active.
@type result: L{Failure <failure.Failure>}
@param result: The reason the child process terminated.
@rtype: L{None} or L{Failure <failure.Failure>}
@return: None, if the process end is expected, or the reason the child
process terminated, if the process end is unexpected.'

def _processEnded(self, result):

    self.done = True
    if (self._timeoutCallID is not None):
        self._timeoutCallID.cancel()
        self._timeoutCallID = None
    else:
        return result
