The R Project SVN R

Rev

Rev 23246 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23246 Rev 25220
Line 38... Line 38...
38
#ifdef Win32
38
#ifdef Win32
39
#include <io.h>
39
#include <io.h>
40
#include <winsock.h>
40
#include <winsock.h>
41
#define _WINSOCKAPI_
41
#define _WINSOCKAPI_
42
extern void R_ProcessEvents(void);
42
extern void R_ProcessEvents(void);
-
 
43
#define R_SelectEx(n,rfd,wrd,efd,tv,ih) select(n,rfd,wrd,efd,tv)
43
#endif
44
#endif
44
 
45
 
45
#ifdef HAVE_STRINGS_H
46
#ifdef HAVE_STRINGS_H
46
   /* may be needed to define bzero in FD_ZERO (eg AIX) */
47
   /* may be needed to define bzero in FD_ZERO (eg AIX) */
47
  #include <strings.h>
48
  #include <strings.h>
Line 664... Line 665...
664
    tv.tv_sec = 0;
665
    tv.tv_sec = 0;
665
    tv.tv_usec = 0;
666
    tv.tv_usec = 0;
666
    FD_ZERO(&rfd);
667
    FD_ZERO(&rfd);
667
    FD_SET(ctxt->controlFd, &rfd);
668
    FD_SET(ctxt->controlFd, &rfd);
668
    /* no-block select call */
669
    /* no-block select call */
669
    switch(select(ctxt->controlFd + 1, &rfd, NULL, NULL, &tv)) {
670
    switch(R_SelectEx(ctxt->controlFd + 1, &rfd, NULL, NULL, &tv, NULL)) {
670
	case 0:
671
	case 0:
671
	    return(0);
672
	    return(0);
672
	case -1:
673
	case -1:
673
#ifdef DEBUG_FTP
674
#ifdef DEBUG_FTP
674
	    perror("select");
675
	    perror("select");
Line 1342... Line 1343...
1342
	FD_ZERO(&rfd);
1343
	FD_ZERO(&rfd);
1343
#endif
1344
#endif
1344
	FD_SET(ctxt->dataFd, &rfd);
1345
	FD_SET(ctxt->dataFd, &rfd);
1345
	if(maxfd < ctxt->dataFd) maxfd = ctxt->dataFd;
1346
	if(maxfd < ctxt->dataFd) maxfd = ctxt->dataFd;
1346
 
1347
 
1347
	res = select(maxfd + 1, &rfd, NULL, NULL, &tv);
1348
	res = R_SelectEx(maxfd + 1, &rfd, NULL, NULL, &tv, NULL);
1348
 
1349
 
1349
	if (res < 0) { /* socket error */
1350
	if (res < 0) { /* socket error */
1350
	    closesocket(ctxt->dataFd); ctxt->dataFd = -1;
1351
	    closesocket(ctxt->dataFd); ctxt->dataFd = -1;
1351
	    return(-1);
1352
	    return(-1);
1352
	}
1353
	}