[Lcdproc] [Patch] Ignore SIGPIPE on the server
Peter Marschall
peter@adpm.de
Sat Mar 3 20:37:01 2007
Hi,
On Friday, 2. March 2007 18:34, Peter McCurdy wrote:
> For the past few days I've been wondering why LCDd sometimes quits
> when I close my client. Today I discovered it's because the server
> doesn't ignore SIGPIPE. If the server ever attempts to write to a
> socket where the client has silently disappeared (which can happen
> even with well-behaved clients), it'll receive SIGPIPE, and the
> default action for SIGPIPE is to terminate the process. This default
> makes sense for standard Unix pipeline commands, but is obviously a
> terrible setting for a server.
>
> This patch gets the server to ignore SIGPIPE, since it already
> properly handles the error from writing to the socket. After applying
> this patch, if you run "killall -PIPE LCDd", the server will continue
> to run, whereas before it would exit. More to the point, if you run
> "killall -KILL lcdproc", the server will always continue to run.
Committed to CVS.
I never experienced the problem on my i386 Debian installation
though I often kill clients in mid-operation.
What system do you use?
> I threw in a fix for the Windows port as well, but I haven't tested
> it. It looks pretty straightforward though.
Never mind.
I guess there are not much users for LCDproc on Windows.
Thanks for helping LCDproc
Peter
--
Peter Marschall
peter@adpm.de