From 64e38ead969c1e4718fc96f554093dea93d0a028 Mon Sep 17 00:00:00 2001 From: damien Date: Thu, 25 Nov 1999 00:54:57 +0000 Subject: - More reformatting merged from OpenBSD CVS - Merged OpenBSD CVS changes: - [channels.c] report from mrwizard@psu.edu via djm@ibs.com.au - [channels.c] set SO_REUSEADDR and SO_LINGER for forwarded ports. chip@valinux.com via damien@ibs.com.au - [nchan.c] it's not an error() if shutdown_write failes in nchan. - [readconf.c] remove dead #ifdef-0-code - [readconf.c servconf.c] strcasecmp instead of tolower - [scp.c] progress meter overflow fix from damien@ibs.com.au - [ssh-add.1 ssh-add.c] SSH_ASKPASS support - [ssh.1 ssh.c] postpone fork_after_authentication until command execution, request/patch from jahakala@cc.jyu.fi via damien@ibs.com.au plus: use daemon() for backgrounding --- scp.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'scp.c') diff --git a/scp.c b/scp.c index 977c3898..faa18277 100644 --- a/scp.c +++ b/scp.c @@ -45,7 +45,7 @@ */ #include "includes.h" -RCSID("$Id: scp.c,v 1.9 1999/11/24 13:26:22 damien Exp $"); +RCSID("$Id: scp.c,v 1.10 1999/11/25 00:54:59 damien Exp $"); #include "ssh.h" #include "xmalloc.h" @@ -97,9 +97,11 @@ char *identity = NULL; /* This is the port to use in contacting the remote site (is non-NULL). */ char *port = NULL; -/* This function executes the given command as the specified user on the given - host. This returns < 0 if execution fails, and >= 0 otherwise. - This assigns the input and output file descriptors on success. */ +/* + * This function executes the given command as the specified user on the + * given host. This returns < 0 if execution fails, and >= 0 otherwise. This + * assigns the input and output file descriptors on success. + */ int do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout) @@ -110,8 +112,10 @@ do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout) fprintf(stderr, "Executing: host %s, user %s, command %s\n", host, remuser ? remuser : "(unspecified)", cmd); - /* Reserve two descriptors so that the real pipes won't get - descriptors 0 and 1 because that will screw up dup2 below. */ + /* + * Reserve two descriptors so that the real pipes won't get + * descriptors 0 and 1 because that will screw up dup2 below. + */ pipe(reserved); /* Create a socket pair for communicating with ssh. */ @@ -970,7 +974,7 @@ run_err(const char *fmt,...) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scp.c,v 1.9 1999/11/24 13:26:22 damien Exp $ + * $Id: scp.c,v 1.10 1999/11/25 00:54:59 damien Exp $ */ char * @@ -1142,7 +1146,7 @@ progressmeter(int flag) (void) gettimeofday(&now, (struct timezone *) 0); cursize = statbytes; if (totalbytes != 0) { - ratio = cursize * 100.0 / totalbytes; + ratio = 100.0 * cursize / totalbytes; ratio = MAX(ratio, 0); ratio = MIN(ratio, 100); } else -- cgit v1.2.1