*/
#include "includes.h"
-RCSID("$OpenBSD: scp.c,v 1.47 2000/12/19 23:17:57 markus Exp $");
+RCSID("$OpenBSD: scp.c,v 1.51 2001/01/21 19:05:55 markus Exp $");
-#include "ssh.h"
#include "xmalloc.h"
-
-#ifndef _PATH_CP
-#define _PATH_CP "cp"
-#endif
+#include "atomicio.h"
+#include "pathnames.h"
+#include "log.h"
#ifdef HAVE___PROGNAME
extern char *__progname;
int showprogress = 1;
/* This is the program to execute for the secured connection. ("ssh" or -S) */
-char *ssh_program = SSH_PROGRAM;
+char *ssh_program = _PATH_SSH_PROGRAM;
/* This is the list of arguments that scp passes to ssh */
struct {
return 0;
}
-void
-fatal(const char *fmt,...)
-{
- va_list ap;
- char buf[1024];
-
- va_start(ap, fmt);
- vsnprintf(buf, sizeof(buf), fmt, ap);
- va_end(ap);
- fprintf(stderr, "%s\n", buf);
- exit(255);
-}
-
typedef struct {
int cnt;
char *buf;
addargs("-oFallBackToRsh no");
fflag = tflag = 0;
- while ((ch = getopt(argc, argv, "dfprtvBCc:i:P:q46S:o:")) != EOF)
+ while ((ch = getopt(argc, argv, "dfprtvBCc:i:P:q46S:o:")) != -1)
switch (ch) {
/* User-visible flags. */
case '4':
if (pgrp == -1)
pgrp = getpgrp();
-#ifdef HAVE_CYGWIN
- /*
- * Cygwin only supports tcgetpgrp() for getting the controlling tty
- * currently.
- */
+#ifdef HAVE_TCGETPGRP
return ((ctty_pgrp = tcgetpgrp(STDOUT_FILENO)) != -1 &&
ctty_pgrp == pgrp);
#else