Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Errno being set to strange values when using IO::Poll

by afoken (Chancellor)
on Sep 26, 2009 at 10:24 UTC ( [id://797670]=note: print w/replies, xml ) Need Help??


in reply to Errno being set to strange values when using IO::Poll

I see several problems:

  • You place a lot of code into your signal handler. Older perls have real problems with that. Newer perls try to cope with the underlying problem by default, but can still show the old behaviour. See "Signals" and "Deferred Signals (Safe Signals)" in perlipc. The safe way of handling signals is just to set a flag and handle the signal in the main loop of the program.
  • Your signal handler modifies errno a.k.a. $!.
  • The code both inside and outside of your signal handler lacks lots of error checks, and you are not using autodie.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://797670]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-25 07:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found