diff options
author | wtc%google.com <devnull@localhost> | 2008-11-21 21:22:28 +0000 |
---|---|---|
committer | wtc%google.com <devnull@localhost> | 2008-11-21 21:22:28 +0000 |
commit | f58af72ae9f5e1a688059d46dbc1eb07f3a95924 (patch) | |
tree | 9b24ded8dbfed70c1d440e89bb9fdfee4e1c0468 | |
parent | 2c5feaa8b416b42113f3cb7c648f99f8e7fe4fa6 (diff) | |
download | nspr-hg-f58af72ae9f5e1a688059d46dbc1eb07f3a95924.tar.gz |
Bug 465435: added a comment to explain the check against FD_SETSIZE in
_PR_MD_PR_POLL. r=aleksey.sanin.
-rw-r--r-- | pr/src/md/windows/w32poll.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pr/src/md/windows/w32poll.c b/pr/src/md/windows/w32poll.c index 0bf5203a..2caaac2a 100644 --- a/pr/src/md/windows/w32poll.c +++ b/pr/src/md/windows/w32poll.c @@ -247,6 +247,12 @@ PRInt32 _PR_MD_PR_POLL(PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout) if (0 != ready) return ready; /* no need to block */ + /* + * FD_SET does nothing if the fd_set's internal fd_array is full. If + * nrd, nwt, or nex is greater than FD_SETSIZE, we know FD_SET must + * have failed to insert an osfd into the corresponding fd_set, and + * therefore we should fail. + */ if ((nrd > FD_SETSIZE) || (nwt > FD_SETSIZE) || (nex > FD_SETSIZE)) { PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0); return -1; |