In the main loop of the router: if the select call fails for
any reason other than an harmless signal (i.e. one whose
handler didn't set a switch to stop the loop), then break
out of the loop and terminate.

The old code would ignore the error and keep looping, using up
ca. 98% of the CPU until somebody killed it.