]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
windows-no-fds-20051217
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 17 Dec 2005 17:26:57 +0000 (17:26 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 17 Dec 2005 17:26:57 +0000 (17:26 +0000)
when collecting rx statistics in response to an RPC query, the rx library
attempts to enumerate the number file descriptors in use.  This is fine
except that file descriptors are a C Run Time Library concept on Windows
and are not related to networking.  In Visual Studio 8, the run time library
will assert() if an invalid file descriptor is passed to fstat() which is
the test used to determine if a file descriptor is valid.

This patch simply returns 0 for the number of file descriptors in use
because that is what would have been returned anyway with the existing
code.  What we probably want to return is the number of open socket
handles.

src/rx/rx_packet.c

index 03be1cfe835349387cfba07b2070d0b0fe395ed1..f31a6c83884c008592cba79bd2171057b65cc679 100644 (file)
@@ -1315,7 +1315,10 @@ rxi_AllocSendPacket(register struct rx_call *call, int want)
 }
 
 #ifndef KERNEL
-
+#ifdef AFS_NT40_ENV     
+/* Windows does not use file descriptors. */
+#define CountFDs(amax) 0
+#else
 /* count the number of used FDs */
 static int
 CountFDs(register int amax)
@@ -1332,7 +1335,7 @@ CountFDs(register int amax)
     }
     return count;
 }
-
+#endif /* AFS_NT40_ENV */
 #else /* KERNEL */
 
 #define CountFDs(amax) amax