mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
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
This commit is contained in:
parent
8dc4ac2147
commit
1400561a5a
11
lib/file.c
11
lib/file.c
@ -152,6 +152,7 @@ CURLcode Curl_file(struct connectdata *conn)
|
|||||||
/* get the fd from the connection phase */
|
/* get the fd from the connection phase */
|
||||||
fd = conn->proto.file->fd;
|
fd = conn->proto.file->fd;
|
||||||
|
|
||||||
|
/*VMS?? -- This only works reliable for STREAMLF files */
|
||||||
if( -1 != fstat(fd, &statbuf)) {
|
if( -1 != fstat(fd, &statbuf)) {
|
||||||
/* we could stat it, then read out the size */
|
/* we could stat it, then read out the size */
|
||||||
expected_size = statbuf.st_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
|
this is both more efficient than the former call to download() and
|
||||||
it avoids problems with select() and recv() on file descriptors
|
it avoids problems with select() and recv() on file descriptors
|
||||||
in Winsock */
|
in Winsock */
|
||||||
|
#ifdef VMS
|
||||||
|
if((signed int)expected_size != -1)
|
||||||
|
#else
|
||||||
if(expected_size != -1)
|
if(expected_size != -1)
|
||||||
|
#endif
|
||||||
Curl_pgrsSetDownloadSize(data, expected_size);
|
Curl_pgrsSetDownloadSize(data, expected_size);
|
||||||
|
|
||||||
while (res == CURLE_OK) {
|
while (res == CURLE_OK) {
|
||||||
nread = read(fd, buf, BUFSIZE-1);
|
nread = read(fd, buf, BUFSIZE-1);
|
||||||
|
|
||||||
if (0 <= nread)
|
if ( nread > 0)
|
||||||
buf[nread] = 0;
|
buf[nread] = 0;
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
if ((signed int)nread <= 0)
|
||||||
|
#else
|
||||||
if (nread <= 0)
|
if (nread <= 0)
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
bytecount += nread;
|
bytecount += nread;
|
||||||
/* NOTE: The following call to fwrite does CR/LF translation on
|
/* NOTE: The following call to fwrite does CR/LF translation on
|
||||||
|
Loading…
Reference in New Issue
Block a user