Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: tcp_close



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) {



Messages sorted by: Reverse Date, Date, Thread, Author