From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26727 invoked from network); 11 Jun 2001 14:18:06 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 11 Jun 2001 14:18:06 -0000 Received: (qmail 19720 invoked by alias); 11 Jun 2001 14:17:42 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14843 Received: (qmail 19709 invoked from network); 11 Jun 2001 14:17:41 -0000 Date: Mon, 11 Jun 2001 10:17:57 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Subject: PATCH: tcp_close Message-ID: <20010611101757.A28819@dman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i One of these days I'll actually get somewhere with this. Index: Src/Modules/tcp.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/tcp.c,v retrieving revision 1.1 diff -u -r1.1 tcp.c --- Src/Modules/tcp.c 2001/06/06 18:53:56 1.1 +++ Src/Modules/tcp.c 2001/06/11 14:16:36 @@ -230,13 +230,21 @@ mod_export int tcp_socket(int domain, int type, int protocol, Tcp_session sess) { - sess->fd = socket(domain, type, protocol); - return sess->fd; + sess->fd = socket(domain, type, protocol); + return sess->fd; } static void tcp_cleanup(void) { +} + +/**/ +mod_export int +tcp_close(Tcp_session sess) +{ + close(sess->fd); + sess->fd = -1; } /* The load/unload routines required by the zsh library interface */ Index: Src/Modules/zftp.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/zftp.c,v retrieving revision 1.14 diff -u -r1.14 zftp.c --- Src/Modules/zftp.c 2001/06/08 03:05:50 1.14 +++ Src/Modules/zftp.c 2001/06/11 14:16:37 @@ -2683,8 +2683,7 @@ } if (zfsess->control.fd != -1) { zfnopen--; - close(zfsess->control.fd); - zfsess->control.fd = -1; + tcp_close(&(zfsess->control)); } if (zfstatfd != -1) {