]> andersk Git - gssapi-openssh.git/blobdiff - openssh/scp.c
merged OPENSSH_3_8P1_GSSAPI_20040304 to gpt-branch
[gssapi-openssh.git] / openssh / scp.c
index 0a9c03248ca27759248b546e731c3c2305c4a261..046f677fca51d286b4efa1e849a1a0ff4c36bfb7 100644 (file)
@@ -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;
@@ -259,7 +259,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;
@@ -275,6 +275,7 @@ main(int argc, char **argv)
                        verbose_mode = 1;
                        break;
                case 'q':
+                       addargs(&args, "-q");
                        showprogress = 0;
                        break;
 
@@ -428,7 +429,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) {
@@ -589,7 +591,7 @@ next:                       (void) close(fd);
                                        haderr = result >= 0 ? EIO : errno;
                                statbytes += result;
                        }
-                       if (limitbw)
+                       if (limit_rate)
                                bwlimit(amt);
                }
                if (showprogress)
@@ -681,7 +683,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;
@@ -907,8 +909,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) {
@@ -1020,8 +1022,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);
 }
This page took 0.034645 seconds and 4 git commands to generate.