[Wifidog] Why WiFiDog Crashes

Tony Bussieres tonyicemanz at yahoo.ca
Sat May 15 17:21:11 EDT 2004


I once had the same problem, and the "clean" way to deal with it is to
put the flag  MSG_NOSIGNAL on your write call...

here's an extract of "man 7 socket"

...
SIGNALS

When  writing onto a connection-oriented socket that has been shut down
(by the local or the remote end) SIGPIPE is sent to the writing process
and  EPIPE  is  returned.   The  signal is not sent when the write call
specified the MSG_NOSIGNAL flag.
...                                                                                

You can check the errno to check if your write call worked properly, if
you have a EPIPE, you can clean up your connection.


Tony



On Fri, 2004-05-14 at 23:37, Philippe April wrote:
> Turns out I was partially wrong.. Found out a SIGPIPE is sent when
> write() returns "broken pipe", and WiFiDog would just quit. It's much
> harder to debug when don't have all the tools to debug.
> 
> I don't know if it's the proper way to handle it, but I just used the
> same handler that we have for SIGCHLD to trap SIGPIPE, which does ...
> nothing about it. Works great!
> 
> It should be much more stable now, I'll let it run and see.
> 
> Whew! Glad I found that bug, it was so annoying.
> 
> Everybody have a great week-end,
-- 
May Linux be with you!


-------------- next part --------------
_______________________________________________
Wifidog mailing list
Wifidog at isf.waglo.com
http://isf.waglo.com/mailman/listinfo/wifidog_isf.waglo.com


More information about the Wifidog mailing list