[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.21.2.1 and 1.21.2.2

version 1.21.2.1, 2002/03/07 17:37:47 version 1.21.2.2, 2002/05/17 00:03:24
Line 88 
Line 88 
 usage(void)  usage(void)
 {  {
         extern char *__progname;          extern char *__progname;
   
         fprintf(stderr,          fprintf(stderr,
             "usage: %s [-vC1] [-b batchfile] [-o option] [-s subsystem|path] [-B buffer_size]\n"              "usage: %s [-vC1] [-b batchfile] [-o option] [-s subsystem|path] [-B buffer_size]\n"
             "            [-F config] [-P direct server path] [-S program]\n"              "            [-F config] [-P direct server path] [-S program]\n"
Line 165 
Line 165 
                 case 'R':                  case 'R':
                         num_requests = strtol(optarg, &cp, 10);                          num_requests = strtol(optarg, &cp, 10);
                         if (num_requests == 0 || *cp != '\0')                          if (num_requests == 0 || *cp != '\0')
                                 fatal("Invalid number of requests \"%s\"",                                  fatal("Invalid number of requests \"%s\"",
                                     optarg);                                      optarg);
                         break;                          break;
                 case 'h':                  case 'h':
Line 174 
Line 174 
                 }                  }
         }          }
   
           log_init(argv[0], ll, SYSLOG_FACILITY_USER, 1);
   
         if (sftp_direct == NULL) {          if (sftp_direct == NULL) {
                 if (optind == argc || argc > (optind + 2))                  if (optind == argc || argc > (optind + 2))
                         usage();                          usage();
Line 203 
Line 205 
                         usage();                          usage();
                 }                  }
   
                 log_init(argv[0], ll, SYSLOG_FACILITY_USER, 1);  
                 addargs(&args, "-oProtocol %d", sshver);                  addargs(&args, "-oProtocol %d", sshver);
   
                 /* no subsystem if the server-spec contains a '/' */                  /* no subsystem if the server-spec contains a '/' */
Line 211 
Line 212 
                         addargs(&args, "-s");                          addargs(&args, "-s");
   
                 addargs(&args, "%s", host);                  addargs(&args, "%s", host);
                 addargs(&args, "%s", (sftp_server != NULL ?                  addargs(&args, "%s", (sftp_server != NULL ?
                     sftp_server : "sftp"));                      sftp_server : "sftp"));
                 args.list[0] = ssh_program;                  args.list[0] = ssh_program;
   
                 fprintf(stderr, "Connecting to %s...\n", host);                  fprintf(stderr, "Connecting to %s...\n", host);
                 connect_to_server(ssh_program, args.list, &in, &out,                  connect_to_server(ssh_program, args.list, &in, &out,
                     &sshpid);                      &sshpid);
         } else {          } else {
                 args.list = NULL;                  args.list = NULL;
                 addargs(&args, "sftp-server");                  addargs(&args, "sftp-server");
   
                 fprintf(stderr, "Attaching to %s...\n", sftp_direct);                  fprintf(stderr, "Attaching to %s...\n", sftp_direct);
                 connect_to_server(sftp_direct, args.list, &in, &out,                  connect_to_server(sftp_direct, args.list, &in, &out,
                     &sshpid);                      &sshpid);
         }          }
   
Line 234 
Line 235 
         if (infile != stdin)          if (infile != stdin)
                 fclose(infile);                  fclose(infile);
   
         if (waitpid(sshpid, NULL, 0) == -1)          while (waitpid(sshpid, NULL, 0) == -1)
                 fatal("Couldn't wait for ssh process: %s", strerror(errno));                  if (errno != EINTR)
                           fatal("Couldn't wait for ssh process: %s",
                               strerror(errno));
   
         exit(0);          exit(0);
 }  }

Legend:
Removed from v.1.21.2.1  
changed lines
  Added in v.1.21.2.2