From aa8d735b8707e2bf9142699fd25034655c821f96 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 23 Mar 2009 22:42:48 +0000 Subject: [PATCH] vol-fssync-server-socket-20090323 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. --- src/vol/fssync-server.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/vol/fssync-server.c b/src/vol/fssync-server.c index 786182dcd..079e1b34a 100644 --- a/src/vol/fssync-server.c +++ b/src/vol/fssync-server.c @@ -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 */ -- 2.39.5