]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-windows-no-fds-20051217
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 17 Dec 2005 17:28:31 +0000 (17:28 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 17 Dec 2005 17:28:31 +0000 (17:28 +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.

(cherry picked from commit 8c3cf4b89445d969c9f85e929d5e030f53773f81)

src/rx/rx_packet.c

index 27a7e9f56f3f483eb422d7272dd8cf0177b9797b..614372c7b4cd2e7b36aca86f28a23535c98aaeb2 100644 (file)
@@ -1314,7 +1314,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)
@@ -1331,7 +1334,7 @@ CountFDs(register int amax)
     }
     return count;
 }
-
+#endif /* AFS_NT40_ENV */
 #else /* KERNEL */
 
 #define CountFDs(amax) amax