]> andersk Git - openssh.git/blobdiff - sftp.c
- markus@cvs.openbsd.org 2002/06/08 05:07:56
[openssh.git] / sftp.c
diff --git a/sftp.c b/sftp.c
index f576ed3d50f061b06c39d2d78cf1b07d7677075f..f941d18faae581b8d92fb11575e955332696206c 100644 (file)
--- a/sftp.c
+++ b/sftp.c
@@ -24,7 +24,7 @@
 
 #include "includes.h"
 
-RCSID("$OpenBSD: sftp.c,v 1.27 2002/03/19 10:49:35 markus Exp $");
+RCSID("$OpenBSD: sftp.c,v 1.29 2002/04/02 17:37:48 markus Exp $");
 
 /* XXX: short-form remote directory listings (like 'ls -C') */
 
@@ -181,6 +181,8 @@ main(int argc, char **argv)
                }
        }
 
+       log_init(argv[0], ll, SYSLOG_FACILITY_USER, 1);
+
        if (sftp_direct == NULL) {
                if (optind == argc || argc > (optind + 2))
                        usage();
@@ -210,7 +212,6 @@ main(int argc, char **argv)
                        usage();
                }
 
-               log_init(argv[0], ll, SYSLOG_FACILITY_USER, 1);
                addargs(&args, "-oProtocol %d", sshver);
 
                /* no subsystem if the server-spec contains a '/' */
@@ -237,8 +238,8 @@ main(int argc, char **argv)
        interactive_loop(in, out, file1, file2);
 
 #if !defined(USE_PIPES)
-        shutdown(in, SHUT_RDWR);
-        shutdown(out, SHUT_RDWR);
+       shutdown(in, SHUT_RDWR);
+       shutdown(out, SHUT_RDWR);
 #endif
 
        close(in);
@@ -246,8 +247,10 @@ main(int argc, char **argv)
        if (infile != stdin)
                fclose(infile);
 
-       if (waitpid(sshpid, NULL, 0) == -1)
-               fatal("Couldn't wait for ssh process: %s", strerror(errno));
+       while (waitpid(sshpid, NULL, 0) == -1)
+               if (errno != EINTR)
+                       fatal("Couldn't wait for ssh process: %s",
+                           strerror(errno));
 
        exit(0);
 }
This page took 0.383422 seconds and 4 git commands to generate.