diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2000-04-11 11:42:12 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2000-04-11 11:42:12 +0000 |
commit | bb8030e117bdccffe0cc42d720abb1641ee955f6 (patch) | |
tree | 2c686b7b866d6f43145fffec24243b8f3b9affd2 /libexec/ftpd | |
parent | 8bb7f3035e043996bcb4d1291dcf8914c5002c99 (diff) |
do not lose descriptors; Takahiro Kambe
Diffstat (limited to 'libexec/ftpd')
-rw-r--r-- | libexec/ftpd/ftpd.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 1c443f5e779..4cada1a6342 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ftpd.c,v 1.69 2000/03/03 15:51:45 bitblt Exp $ */ +/* $OpenBSD: ftpd.c,v 1.70 2000/04/11 11:42:11 deraadt Exp $ */ /* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */ /* @@ -1099,8 +1099,10 @@ retrieve(cmd, name) logxfer(name, st.st_size, start); (void) fclose(dout); data = -1; - pdata = -1; done: + if (pdata >= 0) + (void) close(pdata); + pdata = -1; if (cmd == 0) LOGBYTES("get", name, byte_count); (*closefunc)(fin); @@ -2436,6 +2438,10 @@ send_file_list(whichf) transflag = 0; if (dout != NULL) (void) fclose(dout); + else { + if (pdata >= 0) + close(pdata); + } data = -1; pdata = -1; out: |