X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lib%2Finit.c;h=536a56c605ac75111b10ba0e142d7690c1b41649;hb=eecdc4f3cd5c464ae02823a823993e720664e465;hp=5663f250123ef1b6bccf24b0b84feae768083961;hpb=cd033209559c196f887b4b524de845f323736024;p=deb_libnfs.git diff --git a/lib/init.c b/lib/init.c index 5663f25..536a56c 100644 --- a/lib/init.c +++ b/lib/init.c @@ -16,11 +16,17 @@ */ #define _GNU_SOURCE + +#if defined(WIN32) +#include +#else +#include +#include +#endif + #include #include -#include #include -#include #include #include #include @@ -46,7 +52,11 @@ struct rpc_context *rpc_init_context(void) return NULL; } - rpc->auth = authunix_create_default(); +#if defined(WIN32) + rpc->auth = authunix_create("LibNFS", 65535, 65535, 0, NULL); +#else + rpc->auth = authunix_create_default(); +#endif if (rpc->auth == NULL) { free(rpc->encodebuf); free(rpc); @@ -135,7 +145,11 @@ void rpc_destroy_context(struct rpc_context *rpc) rpc->auth =NULL; if (rpc->fd != -1) { - close(rpc->fd); +#if defined(WIN32) + closesocket(rpc->fd); +#else + close(rpc->fd); +#endif } if (rpc->encodebuf != NULL) {