- correct treatment of timeout=NULL
SKIPPED: psi/tecs/uselect.c
This commit is contained in:
14
uselect.c
14
uselect.c
@ -1,5 +1,6 @@
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
#include "uselect.h"
|
||||
|
||||
/* for logging */
|
||||
@ -13,14 +14,19 @@ int uselect(int nfds,
|
||||
struct timeval *timeout) {
|
||||
|
||||
sigset_t sigmask;
|
||||
struct timespec tmo;
|
||||
struct timespec tmo, *tmoPtr;
|
||||
int result;
|
||||
char buffer[80];
|
||||
|
||||
sigfillset(&sigmask);
|
||||
tmo.tv_sec = timeout->tv_sec;
|
||||
tmo.tv_nsec = timeout->tv_usec * 1000;
|
||||
result = pselect(nfds, readfds, writefds, exceptfds, &tmo, &sigmask);
|
||||
if (timeout) {
|
||||
tmo.tv_sec = timeout->tv_sec;
|
||||
tmo.tv_nsec = timeout->tv_usec * 1000;
|
||||
tmoPtr = &tmo;
|
||||
} else {
|
||||
tmoPtr = NULL;
|
||||
}
|
||||
result = pselect(nfds, readfds, writefds, exceptfds, tmoPtr, &sigmask);
|
||||
if (result < 0 && errno == EINTR) {
|
||||
WriteToCommandLog("SYS>","pselect was interrupted!");
|
||||
}
|
||||
|
Reference in New Issue
Block a user