(again, everything in this reply is untested. Based purely on the problem description)
Ah, that one is another result of the current perl handlers.
The order of execution is now:
- signal happens, triggers perl internals
- flag for this signal is set by internals
- systemcall is interrupted, $! set to EINTR
- perl dispatcher sees flag, starts your signal code
However, this code happens to change $!
- The assign of undef to $conn happens
- You check $conn, see its undef and then go look at $!,
but you get the $! left by your signal handler, not the
older one you really need.
Solved easily enough by adding
local $!;
at the start of your signal handler.
Personally I consider this a perl flaw/bug though. I think perl should localize $! when it calls the deferred user signal code.
|