From 3765a951831226c3743f938de2b426422b6ba06f Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sat, 17 Dec 2005 17:28:31 +0000 Subject: [PATCH] STABLE14-windows-no-fds-20051217 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rx/rx_packet.c b/src/rx/rx_packet.c index 27a7e9f56..614372c7b 100644 --- a/src/rx/rx_packet.c +++ b/src/rx/rx_packet.c @@ -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 -- 2.39.5