diff options
author | Clint Adams <clint@users.sourceforge.net> | 2001-06-11 14:21:57 +0000 |
---|---|---|
committer | Clint Adams <clint@users.sourceforge.net> | 2001-06-11 14:21:57 +0000 |
commit | ae09302120db6252c50d9a3d4ba07960ee6a81b8 (patch) | |
tree | 5db0a2cfe40cbedadaf7a8a7d084d2fbc963b1de | |
parent | 9cc9cc946643961eb5e8ef63be165dcfd0d2ae6a (diff) | |
download | zsh-ae09302120db6252c50d9a3d4ba07960ee6a81b8.tar.gz zsh-ae09302120db6252c50d9a3d4ba07960ee6a81b8.tar.xz zsh-ae09302120db6252c50d9a3d4ba07960ee6a81b8.zip |
14843: tcp_close
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Src/Modules/tcp.c | 12 | ||||
-rw-r--r-- | Src/Modules/zftp.c | 3 |
3 files changed, 16 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog index 07a933a8f..dd5f71346 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-06-11 Clint Adams <clint@zsh.org> + + * 14843: Src/Modules/tcp.c, Src/Modules/zftp.c: + introduce tcp_close and use it to close control fd. + 2001-06-11 Sven Wischnowsky <wischnow@zsh.org> * 14841: Completion/Base/Utility/_values, Src/Zle/computil.c: diff --git a/Src/Modules/tcp.c b/Src/Modules/tcp.c index 744343d67..44a380170 100644 --- a/Src/Modules/tcp.c +++ b/Src/Modules/tcp.c @@ -230,8 +230,8 @@ freehostent(struct hostent *ptr) 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 @@ -239,6 +239,14 @@ 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 */ /**/ diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c index 66bf1e662..5120c6c64 100644 --- a/Src/Modules/zftp.c +++ b/Src/Modules/zftp.c @@ -2683,8 +2683,7 @@ zfclose(int leaveparams) } if (zfsess->control.fd != -1) { zfnopen--; - close(zfsess->control.fd); - zfsess->control.fd = -1; + tcp_close(&(zfsess->control)); } if (zfstatfd != -1) { |