summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/scp.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssh/scp.c')
-rw-r--r--crypto/openssh/scp.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/crypto/openssh/scp.c b/crypto/openssh/scp.c
index 4f9247c..1daa2cc 100644
--- a/crypto/openssh/scp.c
+++ b/crypto/openssh/scp.c
@@ -71,7 +71,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: scp.c,v 1.108 2003/07/18 01:54:25 deraadt Exp $");
+RCSID("$OpenBSD: scp.c,v 1.113 2003/11/23 23:21:21 djm Exp $");
#include "xmalloc.h"
#include "atomicio.h"
@@ -92,7 +92,7 @@ void bwlimit(int);
arglist args;
/* Bandwidth limit */
-off_t limitbw = 0;
+off_t limit_rate = 0;
/* Name of current file being transferred. */
char *curfile;
@@ -257,7 +257,7 @@ main(int argc, char **argv)
speed = strtod(optarg, &endp);
if (speed <= 0 || *endp != '\0')
usage();
- limitbw = speed * 1024;
+ limit_rate = speed * 1024;
break;
case 'p':
pflag = 1;
@@ -273,6 +273,7 @@ main(int argc, char **argv)
verbose_mode = 1;
break;
case 'q':
+ addargs(&args, "-q");
showprogress = 0;
break;
@@ -426,7 +427,8 @@ toremote(char *targ, int argc, char **argv)
}
if (verbose_mode)
fprintf(stderr, "Executing: %s\n", bp);
- (void) system(bp);
+ if (system(bp) != 0)
+ errs = 1;
(void) xfree(bp);
} else { /* local to remote */
if (remin == -1) {
@@ -587,7 +589,7 @@ next: (void) close(fd);
haderr = result >= 0 ? EIO : errno;
statbytes += result;
}
- if (limitbw)
+ if (limit_rate)
bwlimit(amt);
}
if (showprogress)
@@ -679,7 +681,7 @@ bwlimit(int amount)
return;
lamt *= 8;
- wait = (double)1000000L * lamt / limitbw;
+ wait = (double)1000000L * lamt / limit_rate;
bwstart.tv_sec = wait / 1000000L;
bwstart.tv_usec = wait % 1000000L;
@@ -905,8 +907,8 @@ bad: run_err("%s: %s", np, strerror(errno));
cp += j;
statbytes += j;
} while (amt > 0);
-
- if (limitbw)
+
+ if (limit_rate)
bwlimit(4096);
if (count == bp->cnt) {
@@ -1018,8 +1020,8 @@ void
usage(void)
{
(void) fprintf(stderr,
- "usage: scp [-pqrvBC1246] [-F config] [-S program] [-P port]\n"
- " [-c cipher] [-i identity] [-l limit] [-o option]\n"
+ "usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]\n"
+ " [-l limit] [-o ssh_option] [-P port] [-S program]\n"
" [[user@]host1:]file1 [...] [[user@]host2:]file2\n");
exit(1);
}
OpenPOWER on IntegriCloud