chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATCH 2/2] tcp: fix file descriptor leaks and don


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH 2/2] tcp: fix file descriptor leaks and don't clobber errno
Date: Thu, 9 May 2013 17:05:39 +0200
User-agent: Mutt/1.4.2.3i

On Sat, Mar 16, 2013 at 06:00:34PM +0100, Florian Zumbiehl wrote:
> Fix file descriptor leaks in tcp that happen in case of exceptions before 
> ports
> or a listener get returned to the caller. Also, save and restore errno around
> the cleanup close() calls so that the error messages report the original
> failure even if close() modified errno.

Since nobody did anything with this, and the original patch no longer
applies due to other changes, I've rewritten this patch.  My version
avoids introducing a new procedure which sets errno, instead opting to
add an alternative syntax for network-error which remembers the errno,
closes the socket and then invokes network-error/errno.

I've also removed the unnecessary multi-value return of ##net#bind-socket
and the let-optionals stuff in tcp-listen (using #!optional instead).

Finally, I've slightly improved ##net#io-ports so it reports the
location where the error occurred if we're still setting up the ports.

Cheers,
Peter
-- 
http://www.more-magic.net

Attachment: 0001-Fix-file-descriptor-leaks-in-tcp-that-happen-in-case.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]