]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-vol-fssync-server-socket-20090323
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 23 Mar 2009 22:42:59 +0000 (22:42 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 23 Mar 2009 22:42:59 +0000 (22:42 +0000)
LICENSE IPL10

GetHandler() sets up a fdset and returns the max socket fd
which is used with select().  Windows ignores the numfd param
(first param) of select() and therefore computing the max fd
value is meaningless.  We can avoid a number of casts by
not attempting to treat this value as osi_socket.

(cherry picked from commit aa8d735b8707e2bf9142699fd25034655c821f96)

src/vol/fssync-server.c

index 786182dcd361fa0b730f689c828c04c37fd0c58a..079e1b34a4a57dcd29aa6b93ff81e2115844d42a 100644 (file)
@@ -1652,14 +1652,17 @@ static void
 GetHandler(fd_set * fdsetp, int *maxfdp)
 {
     register int i;
-    register osi_socket maxfd = -1;
+    register int maxfd = -1;
     FD_ZERO(fdsetp);
     ObtainReadLock(&FSYNC_handler_lock);       /* just in case */
     for (i = 0; i < MAXHANDLERS; i++)
        if (HandlerFD[i] != -1) {
            FD_SET(HandlerFD[i], fdsetp);
-           if (maxfd < HandlerFD[i] || maxfd == (osi_socket)-1)
+#ifndef AFS_NT40_ENV
+            /* On Windows the nfds parameter to select() is ignored */
+           if (maxfd < HandlerFD[i] || maxfd == (int)-1)
                maxfd = HandlerFD[i];
+#endif /* AFS_NT40_ENV */
        }
     *maxfdp = maxfd;
     ReleaseReadLock(&FSYNC_handler_lock);      /* just in case */