diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | scp.c | 14 |
2 files changed, 14 insertions, 5 deletions
@@ -3,6 +3,9 @@ | |||
3 | - deraadt@cvs.openbsd.org 2005/11/12 18:37:59 | 3 | - deraadt@cvs.openbsd.org 2005/11/12 18:37:59 |
4 | [ssh-add.c] | 4 | [ssh-add.c] |
5 | space | 5 | space |
6 | - deraadt@cvs.openbsd.org 2005/11/12 18:38:15 | ||
7 | [scp.c] | ||
8 | avoid close(-1), as in rcp; ok cloder | ||
6 | 9 | ||
7 | 20051120 | 10 | 20051120 |
8 | - (dtucker) [openbsd-compat/openssl-compat.h] Add comment explaining what | 11 | - (dtucker) [openbsd-compat/openssl-compat.h] Add comment explaining what |
@@ -3312,4 +3315,4 @@ | |||
3312 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM | 3315 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM |
3313 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu | 3316 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu |
3314 | 3317 | ||
3315 | $Id: ChangeLog,v 1.3997 2005/11/22 08:37:08 dtucker Exp $ | 3318 | $Id: ChangeLog,v 1.3998 2005/11/22 08:38:06 dtucker Exp $ |
@@ -71,7 +71,7 @@ | |||
71 | */ | 71 | */ |
72 | 72 | ||
73 | #include "includes.h" | 73 | #include "includes.h" |
74 | RCSID("$OpenBSD: scp.c,v 1.126 2005/09/13 23:40:07 djm Exp $"); | 74 | RCSID("$OpenBSD: scp.c,v 1.127 2005/11/12 18:38:15 deraadt Exp $"); |
75 | 75 | ||
76 | #include "xmalloc.h" | 76 | #include "xmalloc.h" |
77 | #include "atomicio.h" | 77 | #include "atomicio.h" |
@@ -571,7 +571,10 @@ syserr: run_err("%s: %s", name, strerror(errno)); | |||
571 | if (response() < 0) | 571 | if (response() < 0) |
572 | goto next; | 572 | goto next; |
573 | if ((bp = allocbuf(&buffer, fd, 2048)) == NULL) { | 573 | if ((bp = allocbuf(&buffer, fd, 2048)) == NULL) { |
574 | next: (void) close(fd); | 574 | next: if (fd != -1) { |
575 | (void) close(fd); | ||
576 | fd = -1; | ||
577 | } | ||
575 | continue; | 578 | continue; |
576 | } | 579 | } |
577 | if (showprogress) | 580 | if (showprogress) |
@@ -600,8 +603,11 @@ next: (void) close(fd); | |||
600 | if (showprogress) | 603 | if (showprogress) |
601 | stop_progress_meter(); | 604 | stop_progress_meter(); |
602 | 605 | ||
603 | if (close(fd) < 0 && !haderr) | 606 | if (fd != -1) { |
604 | haderr = errno; | 607 | if (close(fd) < 0 && !haderr) |
608 | haderr = errno; | ||
609 | fd = -1; | ||
610 | } | ||
605 | if (!haderr) | 611 | if (!haderr) |
606 | (void) atomicio(vwrite, remout, "", 1); | 612 | (void) atomicio(vwrite, remout, "", 1); |
607 | else | 613 | else |