diff options
author | Damien Miller <djm@mindrot.org> | 2003-01-10 21:40:00 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2003-01-10 21:40:00 +1100 |
commit | 956f3fb28b93420e87a51d1611029accebb2e43b (patch) | |
tree | d1f304e1bf833cef147bec2335b75187a93f9e98 /sftp.c | |
parent | a8ed44b79e6dd78d7871b0fb8149951b54662ef5 (diff) |
- (djm) OpenBSD CVS Sync
- djm@cvs.openbsd.org 2003/01/08 23:53:26
[sftp.1 sftp.c sftp-int.c sftp-int.h]
Cleanup error handling for batchmode
Allow blank lines and comments in input
Ability to suppress abort on error in batchmode ("-put blah")
Fixes mindrot bug #452; markus@ ok
Diffstat (limited to 'sftp.c')
-rw-r--r-- | sftp.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | 26 | ||
27 | RCSID("$OpenBSD: sftp.c,v 1.32 2002/11/27 17:53:35 markus Exp $"); | 27 | RCSID("$OpenBSD: sftp.c,v 1.33 2003/01/08 23:53:26 djm Exp $"); |
28 | 28 | ||
29 | /* XXX: short-form remote directory listings (like 'ls -C') */ | 29 | /* XXX: short-form remote directory listings (like 'ls -C') */ |
30 | 30 | ||
@@ -108,7 +108,7 @@ usage(void) | |||
108 | int | 108 | int |
109 | main(int argc, char **argv) | 109 | main(int argc, char **argv) |
110 | { | 110 | { |
111 | int in, out, ch; | 111 | int in, out, ch, err; |
112 | pid_t sshpid; | 112 | pid_t sshpid; |
113 | char *host, *userhost, *cp, *file2; | 113 | char *host, *userhost, *cp, *file2; |
114 | int debug_level = 0, sshver = 2; | 114 | int debug_level = 0, sshver = 2; |
@@ -237,7 +237,7 @@ main(int argc, char **argv) | |||
237 | &sshpid); | 237 | &sshpid); |
238 | } | 238 | } |
239 | 239 | ||
240 | interactive_loop(in, out, file1, file2); | 240 | err = interactive_loop(in, out, file1, file2); |
241 | 241 | ||
242 | #if !defined(USE_PIPES) | 242 | #if !defined(USE_PIPES) |
243 | shutdown(in, SHUT_RDWR); | 243 | shutdown(in, SHUT_RDWR); |
@@ -254,5 +254,5 @@ main(int argc, char **argv) | |||
254 | fatal("Couldn't wait for ssh process: %s", | 254 | fatal("Couldn't wait for ssh process: %s", |
255 | strerror(errno)); | 255 | strerror(errno)); |
256 | 256 | ||
257 | exit(0); | 257 | exit(err == 0 ? 0 : 1); |
258 | } | 258 | } |