X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=win32%2Fwin32sck.c;h=947a42a28ee86c5f3dbbb857c5a66bd9b7fccfca;hb=ff019190b10d1548efb9adf56145a5feb1d2cfef;hp=4fb20473b4ac7162d3edda9f80b7601379bc9ea1;hpb=acfe0abcedaf592fb4b9cb69ce3468308ae99d91;p=p5sagit%2Fp5-mst-13.2.git diff --git a/win32/win32sck.c b/win32/win32sck.c index 4fb2047..947a42a 100644 --- a/win32/win32sck.c +++ b/win32/win32sck.c @@ -291,7 +291,7 @@ win32_select(int nfds, Perl_fd_set* rd, Perl_fd_set* wr, Perl_fd_set* ex, const int r; #ifdef USE_SOCKETS_AS_HANDLES Perl_fd_set dummy; - int i, fd, bit, offset; + int i, fd; FD_SET nrd, nwr, nex, *prd, *pwr, *pex; /* winsock seems incapable of dealing with all three null fd_sets, @@ -482,7 +482,7 @@ my_fclose (FILE *pf) #undef fstat int -my_fstat(int fd, struct stat *sbufptr) +my_fstat(int fd, Stat_t *sbufptr) { /* This fixes a bug in fstat() on Windows 9x. fstat() uses the * GetFileType() win32 syscall, which will fail on Windows 9x. @@ -492,8 +492,13 @@ my_fstat(int fd, struct stat *sbufptr) * sbufptr->st_mode. */ int osf; - if (!wsock_started || IsWinNT()) + if (!wsock_started || IsWinNT()) { +#if defined(WIN64) || defined(USE_LARGE_FILES) + return _fstati64(fd, sbufptr); +#else return fstat(fd, sbufptr); +#endif + } osf = TO_SOCKET(fd); if (osf != -1) { @@ -512,11 +517,15 @@ my_fstat(int fd, struct stat *sbufptr) sbufptr->st_nlink = 1; sbufptr->st_uid = sbufptr->st_gid = sbufptr->st_ino = 0; sbufptr->st_atime = sbufptr->st_mtime = sbufptr->st_ctime = 0; - sbufptr->st_size = (off_t)0; + sbufptr->st_size = (Off_t)0; return 0; } } +#if defined(WIN64) || defined(USE_LARGE_FILES) + return _fstati64(fd, sbufptr); +#else return fstat(fd, sbufptr); +#endif } struct hostent *