Revision: 6539
          http://playerstage.svn.sourceforge.net/playerstage/?rev=6539&view=rev
Author:   thjc
Date:     2008-06-11 13:46:40 -0700 (Wed, 11 Jun 2008)

Log Message:
-----------
fixed off by one error in filewatcher

Modified Paths:
--------------
    code/player/branches/release-2-1-patches/libplayercore/filewatcher.cc

Modified: code/player/branches/release-2-1-patches/libplayercore/filewatcher.cc
===================================================================
--- code/player/branches/release-2-1-patches/libplayercore/filewatcher.cc       
2008-06-11 20:29:28 UTC (rev 6538)
+++ code/player/branches/release-2-1-patches/libplayercore/filewatcher.cc       
2008-06-11 20:46:40 UTC (rev 6539)
@@ -77,6 +77,7 @@
        t.tv_sec = static_cast<int> (floor(Timeout));
        t.tv_usec = static_cast<int> ((Timeout - static_cast<int> 
(floor(Timeout))) * 1e6);
        Unlock();
+
        int ret = select (maxfd+1,&ReadFds,&WriteFds,&ExceptFds,&t);
 
        if (ret < 0)
@@ -92,14 +93,16 @@
        {
                int fd = WatchedFiles[ii].fd;
                QueuePointer &q = WatchedFiles[ii].queue;
-               if (fd > 0 && fd < maxfd)
+               if (fd > 0 && fd <= maxfd)
                {
                        if ((WatchedFiles[ii].Read && FD_ISSET(fd,&ReadFds)) ||
                                        (WatchedFiles[ii].Write && 
FD_ISSET(fd,&WriteFds)) ||
                                        (WatchedFiles[ii].Except && 
FD_ISSET(fd,&ExceptFds)))
                        {
                                if (q != NULL)
+                               {
                                        q->DataAvailable();
+                               }
                                else
                                        queueless_count++;
 
@@ -121,6 +124,7 @@
 int FileWatcher::AddFileWatch(int fd, QueuePointer & queue, bool WatchRead, 
bool WatchWrite, bool WatchExcept)
 {
        Lock();
+       fprintf(stderr,"Added file watch %d \n",fd);
        // find the first available file descriptor
        struct fd_driver_pair *next_entry = NULL;
        if (WatchedFilesArrayCount < WatchedFilesArraySize)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to