summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--scp.c14
2 files changed, 14 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index fb7cdbdfb..b04403b37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
720051120 1020051120
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 $
diff --git a/scp.c b/scp.c
index 58c00442f..59285abca 100644
--- a/scp.c
+++ b/scp.c
@@ -71,7 +71,7 @@
71 */ 71 */
72 72
73#include "includes.h" 73#include "includes.h"
74RCSID("$OpenBSD: scp.c,v 1.126 2005/09/13 23:40:07 djm Exp $"); 74RCSID("$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) {
574next: (void) close(fd); 574next: 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