зеркало из https://github.com/Azure/sonic-openssh.git
- deraadt@cvs.openbsd.org 2005/11/12 18:38:15
[scp.c] avoid close(-1), as in rcp; ok cloder
This commit is contained in:
Родитель
b736d8d829
Коммит
33f86bc284
|
@ -3,6 +3,9 @@
|
|||
- deraadt@cvs.openbsd.org 2005/11/12 18:37:59
|
||||
[ssh-add.c]
|
||||
space
|
||||
- deraadt@cvs.openbsd.org 2005/11/12 18:38:15
|
||||
[scp.c]
|
||||
avoid close(-1), as in rcp; ok cloder
|
||||
|
||||
20051120
|
||||
- (dtucker) [openbsd-compat/openssl-compat.h] Add comment explaining what
|
||||
|
@ -3312,4 +3315,4 @@
|
|||
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
|
||||
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
|
||||
|
||||
$Id: ChangeLog,v 1.3997 2005/11/22 08:37:08 dtucker Exp $
|
||||
$Id: ChangeLog,v 1.3998 2005/11/22 08:38:06 dtucker Exp $
|
||||
|
|
14
scp.c
14
scp.c
|
@ -71,7 +71,7 @@
|
|||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: scp.c,v 1.126 2005/09/13 23:40:07 djm Exp $");
|
||||
RCSID("$OpenBSD: scp.c,v 1.127 2005/11/12 18:38:15 deraadt Exp $");
|
||||
|
||||
#include "xmalloc.h"
|
||||
#include "atomicio.h"
|
||||
|
@ -571,7 +571,10 @@ syserr: run_err("%s: %s", name, strerror(errno));
|
|||
if (response() < 0)
|
||||
goto next;
|
||||
if ((bp = allocbuf(&buffer, fd, 2048)) == NULL) {
|
||||
next: (void) close(fd);
|
||||
next: if (fd != -1) {
|
||||
(void) close(fd);
|
||||
fd = -1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (showprogress)
|
||||
|
@ -600,8 +603,11 @@ next: (void) close(fd);
|
|||
if (showprogress)
|
||||
stop_progress_meter();
|
||||
|
||||
if (close(fd) < 0 && !haderr)
|
||||
haderr = errno;
|
||||
if (fd != -1) {
|
||||
if (close(fd) < 0 && !haderr)
|
||||
haderr = errno;
|
||||
fd = -1;
|
||||
}
|
||||
if (!haderr)
|
||||
(void) atomicio(vwrite, remout, "", 1);
|
||||
else
|
||||
|
|
Загрузка…
Ссылка в новой задаче