aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-08-06 12:17:43 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-08-06 12:17:43 +0000
commit1400561a5a52154ef0188865c059f874a65ee6f8 (patch)
tree74368b9213a6cddf08052da2a0fa86c8540f0c92
parent8dc4ac21475e0b916e820c02200a19ad0c139359 (diff)
VMS #ifdefs added. several related to size_t problems that we must address
globally anyway... check these as soon as the size_t fixes are in place
-rw-r--r--lib/file.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/file.c b/lib/file.c
index 452980f54..1ce341b29 100644
--- a/lib/file.c
+++ b/lib/file.c
@@ -152,6 +152,7 @@ CURLcode Curl_file(struct connectdata *conn)
/* get the fd from the connection phase */
fd = conn->proto.file->fd;
+/*VMS?? -- This only works reliable for STREAMLF files */
if( -1 != fstat(fd, &statbuf)) {
/* we could stat it, then read out the size */
expected_size = statbuf.st_size;
@@ -161,16 +162,24 @@ CURLcode Curl_file(struct connectdata *conn)
this is both more efficient than the former call to download() and
it avoids problems with select() and recv() on file descriptors
in Winsock */
+#ifdef VMS
+ if((signed int)expected_size != -1)
+#else
if(expected_size != -1)
+#endif
Curl_pgrsSetDownloadSize(data, expected_size);
while (res == CURLE_OK) {
nread = read(fd, buf, BUFSIZE-1);
- if (0 <= nread)
+ if ( nread > 0)
buf[nread] = 0;
+#ifdef VMS
+ if ((signed int)nread <= 0)
+#else
if (nread <= 0)
+#endif
break;
bytecount += nread;
/* NOTE: The following call to fwrite does CR/LF translation on