From 4b680153e7696af2a2c50d7fbdb24e52d11659ff Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 27 Jun 2008 00:31:59 +0000 Subject: [PATCH] Don't do FD_SETSIZE check on Windows. Also, for form's sake, use closesocket instead of close inside the check. Kevin or Jeff, could you please verify that the code works again? ticket: 5925 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20479 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/sendto_kdc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/krb5/os/sendto_kdc.c b/src/lib/krb5/os/sendto_kdc.c index 87d78c8a0..2063b302f 100644 --- a/src/lib/krb5/os/sendto_kdc.c +++ b/src/lib/krb5/os/sendto_kdc.c @@ -671,12 +671,14 @@ start_connection (struct conn_state *state, dprint("socket: %m creating with af %d\n", state->err, ai->ai_family); return -1; /* try other hosts */ } +#ifndef _WIN32 /* On Windows FD_SETSIZE is a count, not a max value. */ if (fd >= FD_SETSIZE) { - close(fd); + closesocket(fd); state->err = EMFILE; dprint("socket: fd %d too high\n", fd); return -1; } +#endif set_cloexec_fd(fd); /* Make it non-blocking. */ if (ai->ai_socktype == SOCK_STREAM) { -- 2.26.2