Do not exit if SO_LINGER was not accepted.
Do not log at level ERR non-catastrophic events.
The caller exits, no need to do it in the callee.
No change in logic, just moved things around to make more functions static.