Discretion is the better part of valour. Sometimes, a DNF is not quitting, but accepting the fact that you were not ready for that event.
I agree with Ollie, that quitting only occurs when you mentally shut down. If the body is willing and the mind is not, then you are quiting. But if the body cannot do the task at hand, it is not quitting.