From 3d17a493aadc40272ec80c5a44aff8f778473f67 Mon Sep 17 00:00:00 2001 From: Bjorn Sandell Date: Thu, 16 Mar 2006 10:31:46 +0000 Subject: Try to display errormessage even if remout == -1 ok djm@, markus@ --- usr.bin/ssh/scp.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'usr.bin/ssh') 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 #include @@ -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); -- cgit v1.2.3