[BACK]Return to sftp.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/sftp.c between version 1.9 and 1.10

version 1.9, 2001/03/03 23:52:22 version 1.10, 2001/03/06 06:11:44
Line 43 
Line 43 
 int use_ssh1 = 0;  int use_ssh1 = 0;
 char *ssh_program = _PATH_SSH_PROGRAM;  char *ssh_program = _PATH_SSH_PROGRAM;
 char *sftp_server = NULL;  char *sftp_server = NULL;
   FILE* infile;
   
 void  void
 connect_to_server(char **args, int *in, int *out, pid_t *sshpid)  connect_to_server(char **args, int *in, int *out, pid_t *sshpid)
Line 140 
Line 141 
 void  void
 usage(void)  usage(void)
 {  {
         fprintf(stderr, "usage: sftp [-1vC] [-osshopt=value] [user@]host\n");          fprintf(stderr, "usage: sftp [-1vC] [-b batchfile] [-osshopt=value] [user@]host\n");
         exit(1);          exit(1);
 }  }
   
Line 154 
Line 155 
         extern int optind;          extern int optind;
         extern char *optarg;          extern char *optarg;
   
           infile = stdin;         /* Read from STDIN unless changed by -b */
         debug_level = compress_flag = 0;          debug_level = compress_flag = 0;
   
         while ((ch = getopt(argc, argv, "1hvCo:s:S:")) != -1) {          while ((ch = getopt(argc, argv, "1hvCo:s:S:b:")) != -1) {
                 switch (ch) {                  switch (ch) {
                 case 'C':                  case 'C':
                         compress_flag = 1;                          compress_flag = 1;
Line 179 
Line 181 
                 case 'S':                  case 'S':
                         ssh_program = optarg;                          ssh_program = optarg;
                         break;                          break;
                   case 'b':
                           if (infile == stdin) {
                                   infile = fopen(optarg, "r");
                                   if (infile == NULL)
                                           fatal("%s (%s).", strerror(errno), optarg);
                           } else
                                   fatal("Filename already specified.");
                           break;
                 case 'h':                  case 'h':
                 default:                  default:
                         usage();                          usage();
Line 245 
Line 255 
   
         close(in);          close(in);
         close(out);          close(out);
           if (infile != stdin)
                   fclose(infile);
   
         if (waitpid(sshpid, NULL, 0) == -1)          if (waitpid(sshpid, NULL, 0) == -1)
                 fatal("Couldn't wait for ssh process: %s", strerror(errno));                  fatal("Couldn't wait for ssh process: %s", strerror(errno));

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10