Re: [Patch] libfetch - closing the cached FTP connection

2010-11-05 Thread Nick Hibma
Mark, My 2 cents: Isn't it more appropriate to set FD_CLOEXEC on the fd? fcntl(fd, F_SETFD, FD_CLOEXEC); It doesn't sound like you ever want to have a cached connection be copied into the child. Mum and child calling daddy using the same phone line isn't going to make the

Re: [Patch] libfetch - closing the cached FTP connection

2010-11-05 Thread Garrett Cooper
On Fri, Nov 5, 2010 at 1:38 AM, Nick Hibma n...@van-laarhoven.org wrote: Mark, My 2 cents: Isn't it more appropriate to set FD_CLOEXEC on the fd?        fcntl(fd, F_SETFD, FD_CLOEXEC); It doesn't sound like you ever want to have a cached connection be copied into the child. Mum and child

Re: [Patch] libfetch - closing the cached FTP connection

2010-11-05 Thread Mark Johnston
On Fri, Nov 05, 2010 at 09:38:24AM +0100, Nick Hibma wrote: Mark, My 2 cents: Isn't it more appropriate to set FD_CLOEXEC on the fd? fcntl(fd, F_SETFD, FD_CLOEXEC); It doesn't sound like you ever want to have a cached connection be copied into the child. Mum and child calling

Re: [Patch] libfetch - closing the cached FTP connection

2010-11-05 Thread Nick Hibma
I think using fcntl is nicer than having a close the cached connection function, but I don't think I can get around this problem without changing something in libfetch. I think libfetch should set the Close-On-Exec flag. It's wrong to have these files propagate to children.

Re: [Patch] libfetch - closing the cached FTP connection

2010-11-05 Thread Mark Johnston
On Fri, Nov 05, 2010 at 07:27:43PM +0100, Nick Hibma wrote: I think using fcntl is nicer than having a close the cached connection function, but I don't think I can get around this problem without changing something in libfetch. I think libfetch should set the Close-On-Exec flag. It's

[Patch] libfetch - closing the cached FTP connection

2010-10-24 Thread Mark Johnston
Hello, We've run into problems with pkg_add because of some caching behaviour in libfetch. Specifically, after an FTP transfer, a connection to the FTP server is held open by the cached_connection pointer in ftp.c. Thus, if one requests a file with fetchGetFTP() and later closes the connection