- changed select calls to newly indroduced uselect
SKIPPED: psi/sinqhttpprot.c
This commit is contained in:
9
ascon.c
9
ascon.c
@ -12,6 +12,7 @@
|
||||
#include "sics.h"
|
||||
#include "splitter.h"
|
||||
#include "ascon.i"
|
||||
#include "uselect.h"
|
||||
|
||||
/*
|
||||
CreateSocketAdress stolen from Tcl. Thanks to John Ousterhout
|
||||
@ -161,7 +162,7 @@ int AsconReadGarbage(int fd) {
|
||||
result = 0;
|
||||
do {
|
||||
FD_SET(fd, &rmask);
|
||||
ret = select(fd + 1, &rmask, NULL, NULL, &tmo);
|
||||
ret = uselect(fd + 1, &rmask, NULL, NULL, &tmo);
|
||||
if (ret > 0) {
|
||||
l = recv(fd, garbage, sizeof garbage, 0);
|
||||
if (l > 0) {
|
||||
@ -199,7 +200,7 @@ int AsconConnectSuccess(int fd) {
|
||||
FD_ZERO(&rmask);
|
||||
FD_SET(fd, &wmask);
|
||||
FD_SET(fd, &rmask);
|
||||
ret = select(fd + 1, &rmask, &wmask, NULL, &tmo);
|
||||
ret = uselect(fd + 1, &rmask, &wmask, NULL, &tmo);
|
||||
if (ret > 0) {
|
||||
assert(FD_ISSET(fd, &wmask));
|
||||
if (FD_ISSET(fd, &rmask)) { /* there may already be data for read */
|
||||
@ -223,7 +224,7 @@ int AsconReadChar(int fd, char *chr) {
|
||||
|
||||
FD_ZERO(&rmask);
|
||||
FD_SET(fd, &rmask);
|
||||
ret = select(fd + 1, &rmask, NULL, NULL, &tmo);
|
||||
ret = uselect(fd + 1, &rmask, NULL, NULL, &tmo);
|
||||
if (ret <= 0) return ret;
|
||||
ret = recv(fd, chr, 1, 0);
|
||||
/* PrintChar(*chr); */
|
||||
@ -252,7 +253,7 @@ int AsconWriteChars(int fd, char *data, int length) {
|
||||
*/
|
||||
FD_ZERO(&wmask);
|
||||
FD_SET(fd, &wmask);
|
||||
ret = select(fd + 1, NULL, &wmask, NULL, &tmo);
|
||||
ret = uselect(fd + 1, NULL, &wmask, NULL, &tmo);
|
||||
if (ret <= 0) return ASCON_SELECT_ERROR;
|
||||
ret = send(fd, data, length, 0);
|
||||
if (ret > 0) return ret;
|
||||
|
Reference in New Issue
Block a user