summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/scp.c
diff options
context:
space:
mode:
authorBjorn Sandell <biorn@cvs.openbsd.org>2006-03-16 10:31:46 +0000
committerBjorn Sandell <biorn@cvs.openbsd.org>2006-03-16 10:31:46 +0000
commit3d17a493aadc40272ec80c5a44aff8f778473f67 (patch)
tree3b38fdc8f8091b1c0492cf96cbcabc449051a8bd /usr.bin/ssh/scp.c
parent200129b8df5e0d9beb3f24b4fb1efb587526c0ec (diff)
Try to display errormessage even if remout == -1
ok djm@, markus@
Diffstat (limited to 'usr.bin/ssh/scp.c')
-rw-r--r--usr.bin/ssh/scp.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c
index cc1a1dc86d4..9fd77c58848 100644
--- a/usr.bin/ssh/scp.c
+++ b/usr.bin/ssh/scp.c
@@ -71,7 +71,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: scp.c,v 1.135 2006/02/22 00:04:44 stevesk Exp $");
+RCSID("$OpenBSD: scp.c,v 1.136 2006/03/16 10:31:45 biorn Exp $");
#include <sys/types.h>
#include <sys/wait.h>
@@ -1092,15 +1092,15 @@ run_err(const char *fmt,...)
va_list ap;
++errs;
- if (fp == NULL && !(fp = fdopen(remout, "w")))
- return;
- (void) fprintf(fp, "%c", 0x01);
- (void) fprintf(fp, "scp: ");
- va_start(ap, fmt);
- (void) vfprintf(fp, fmt, ap);
- va_end(ap);
- (void) fprintf(fp, "\n");
- (void) fflush(fp);
+ if (fp != NULL || (remout != -1 && (fp = fdopen(remout, "w")))) {
+ (void) fprintf(fp, "%c", 0x01);
+ (void) fprintf(fp, "scp: ");
+ va_start(ap, fmt);
+ (void) vfprintf(fp, fmt, ap);
+ va_end(ap);
+ (void) fprintf(fp, "\n");
+ (void) fflush(fp);
+ }
if (!iamremote) {
va_start(ap, fmt);