summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-09-29 23:01:36 +1100
committerDamien Miller <djm@mindrot.org>2000-09-29 23:01:36 +1100
commit78315eb6d6bf411b07d9e0bc1ede41fae9484f25 (patch)
tree6c1ff91e092df4d86b076f7f4917764bb6d17f5e /scp.c
parentcb5e44a440c1b310a9dc5b8b5abe32fe11ed479b (diff)
- (djm) Merged big SCO portability patch from Tim Rice
<tim@multitalents.net>
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/scp.c b/scp.c
index 72949d0e..356d97e6 100644
--- a/scp.c
+++ b/scp.c
@@ -80,7 +80,9 @@ RCSID("$OpenBSD: scp.c,v 1.40 2000/09/21 11:11:42 markus Exp $");
#include "ssh.h"
#include "xmalloc.h"
+#ifndef _PATH_CP
#define _PATH_CP "cp"
+#endif
/* For progressmeter() -- number of seconds before xfer considered "stalled" */
#define STALLTIME 5
@@ -915,12 +917,20 @@ bad: run_err("%s: %s", np, strerror(errno));
#endif
if (pflag) {
if (exists || omode != mode)
+#ifdef HAVE_FCHMOD
if (fchmod(ofd, omode))
+#else /* HAVE_FCHMOD */
+ if (chmod(np, omode))
+#endif /* HAVE_FCHMOD */
run_err("%s: set mode: %s",
np, strerror(errno));
} else {
if (!exists && omode != mode)
+#ifdef HAVE_FCHMOD
if (fchmod(ofd, omode & ~mask))
+#else /* HAVE_FCHMOD */
+ if (chmod(np, omode & ~mask))
+#endif /* HAVE_FCHMOD */
run_err("%s: set mode: %s",
np, strerror(errno));
}
@@ -1086,6 +1096,7 @@ allocbuf(bp, fd, blksize)
int fd, blksize;
{
size_t size;
+#ifdef HAVE_ST_BLKSIZE
struct stat stb;
if (fstat(fd, &stb) < 0) {
@@ -1097,6 +1108,9 @@ allocbuf(bp, fd, blksize)
else
size = blksize + (stb.st_blksize - blksize % stb.st_blksize) %
stb.st_blksize;
+#else /* HAVE_ST_BLKSIZE */
+ size = blksize;
+#endif /* HAVE_ST_BLKSIZE */
if (bp->cnt >= size)
return (bp);
if (bp->buf == NULL)