Patch from Secure Endpoints/Asanka Herath for windows support

This commit is contained in:
Love Hornquist Astrand
2009-12-21 08:45:28 +01:00
parent 09f478ab98
commit 687db64c56
97 changed files with 2452 additions and 794 deletions

View File

@@ -85,12 +85,26 @@ fd_free(krb5_storage * sp)
* @sa krb5_storage_from_data()
*/
krb5_storage * KRB5_LIB_FUNCTION
krb5_storage_from_fd(int fd)
KRB5_LIB_FUNCTION krb5_storage * KRB5_LIB_CALL
krb5_storage_from_fd(krb5_socket_t fd_in)
{
krb5_storage *sp;
int fd;
#ifdef SOCKET_IS_NOT_AN_FD
#ifdef _MSC_VER
if (_get_osfhandle(fd_in) != -1) {
fd = dup(fd_in);
} else {
fd = _open_osfhandle(fd_in, 0);
}
#else
#error Dont know how to deal with fd that may or may not be a socket.
#endif
#else /* SOCKET_IS_NOT_AN_FD */
fd = dup(fd_in);
#endif
fd = dup(fd);
if (fd < 0)
return NULL;