diff options
Diffstat (limited to 'sftp-client.c')
-rw-r--r-- | sftp-client.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sftp-client.c b/sftp-client.c index 760a224e2..7c234ce2d 100644 --- a/sftp-client.c +++ b/sftp-client.c | |||
@@ -662,7 +662,11 @@ do_download(int fd_in, int fd_out, char *remote_path, char *local_path, | |||
662 | status = do_close(fd_in, fd_out, handle, handle_len); | 662 | status = do_close(fd_in, fd_out, handle, handle_len); |
663 | 663 | ||
664 | /* Override umask and utimes if asked */ | 664 | /* Override umask and utimes if asked */ |
665 | #ifdef HAVE_FCHMOD | ||
665 | if (pflag && fchmod(local_fd, mode) == -1) | 666 | if (pflag && fchmod(local_fd, mode) == -1) |
667 | #else | ||
668 | if (pflag && chmod(local_path, mode) == -1) | ||
669 | #endif /* HAVE_FCHMOD */ | ||
666 | error("Couldn't set mode on \"%s\": %s", local_path, | 670 | error("Couldn't set mode on \"%s\": %s", local_path, |
667 | strerror(errno)); | 671 | strerror(errno)); |
668 | if (pflag && (a->flags & SSH2_FILEXFER_ATTR_ACMODTIME)) { | 672 | if (pflag && (a->flags & SSH2_FILEXFER_ATTR_ACMODTIME)) { |