summaryrefslogtreecommitdiffstats
path: root/lib/libftpio
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-08-21 01:23:33 +0000
committerjkh <jkh@FreeBSD.org>1996-08-21 01:23:33 +0000
commit8a29a23657171cbd0efffa09633438c4a18afc91 (patch)
tree4a3ac7d02eadc9f446a0e7afc7e008cd2eb8187a /lib/libftpio
parentfc1487cdb0526da63e7c8dbf92b1bcf3e66d356c (diff)
downloadFreeBSD-src-8a29a23657171cbd0efffa09633438c4a18afc91.zip
FreeBSD-src-8a29a23657171cbd0efffa09633438c4a18afc91.tar.gz
Implement a change suggested by Archie Cobbs - the seekto argument should
be zero'd only if the operation *fails*, indicating that the file starting offset is effectively zero. This makes more sense.
Diffstat (limited to 'lib/libftpio')
-rw-r--r--lib/libftpio/ftpio.32
-rw-r--r--lib/libftpio/ftpio.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/libftpio/ftpio.3 b/lib/libftpio/ftpio.3
index 8c57dd8..15631e7 100644
--- a/lib/libftpio/ftpio.3
+++ b/lib/libftpio/ftpio.3
@@ -113,7 +113,7 @@ as a restart point for the file, that is to say that the stream
returned will point
.Fa *seekto
bytes into the file gotten (this is handy for restarting failed
-transfers efficiently). If the seek operation succeeds, the value
+transfers efficiently). If the seek operation fails, the value
of
.Fa *seekto
will be zero'd.
diff --git a/lib/libftpio/ftpio.c b/lib/libftpio/ftpio.c
index e0555e2..854a968 100644
--- a/lib/libftpio/ftpio.c
+++ b/lib/libftpio/ftpio.c
@@ -14,7 +14,7 @@
* Turned inside out. Now returns xfers as new file ids, not as a special
* `state' of FTP_t
*
- * $Id: ftpio.c,v 1.9 1996/08/03 11:58:53 jkh Exp $
+ * $Id: ftpio.c,v 1.10 1996/08/21 01:12:10 jkh Exp $
*
*/
@@ -676,9 +676,10 @@ ftp_file_op(FTP_t ftp, char *operation, char *file, FILE **fp, char *mode, int *
if (i < 0 || FTP_TIMEOUT(i)) {
close(s);
ftp->errno = i;
+ *seekto = 0;
return i;
}
- else if (i != 350)
+ else if (i == 350)
*seekto = 0;
}
i = cmd(ftp, "%s %s", operation, file);
OpenPOWER on IntegriCloud