Skip to content

Commit

Permalink
os2-ftp: fix select call for OS/2
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalak committed Nov 5, 2024
1 parent e12b6ed commit 2faebc9
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions kermit/k95/ckcftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -4984,6 +4984,7 @@ check_data_connection(fd,fc) int fd, fc;
#endif /* CK_ANSIC */
{
int x;
#ifdef BSDSELECT
struct timeval tv;
fd_set in, out, err;

Expand All @@ -5002,19 +5003,30 @@ check_data_connection(fd,fc) int fd, fc;
#else
x = select(FD_SETSIZE,&in,&out,&err,&tv);
#endif /* INTSELECT */
#else /* BSDSELECT */
#ifdef IBMSELECT
if (ftp_timeout < 1L)
return(0);

if (fc) { /* write */
x = select(&fd, 0, 1, 0, ftp_timeout * 1000L);
} else { /* read */
x = select(&fd, 1, 0, 0, ftp_timeout * 1000L);
}
#endif /* IBMSELECT */
#endif /* BSDSELECT */
if (x == 0) {
#ifdef EWOULDBLOCK
errno = EWOULDBLOCK;
errno = EWOULDBLOCK;
#else
#ifdef EAGAIN
errno = EAGAIN;
errno = EAGAIN;
#else
errno = 11;
errno = 11;
#endif /* EAGAIN */
#endif /* EWOULDBLOCK */
debug(F100,"ftp check_data_connection TIMOUT","",0);
return(-3);
debug(F100,"ftp check_data_connection TIMOUT","",0);
return(-3);
}
return(0);
}
Expand Down

0 comments on commit 2faebc9

Please sign in to comment.