From: Ronnie Sahlberg Date: Sat, 3 Sep 2011 00:57:42 +0000 (+1000) Subject: Merge branch 'win32' into win32-3 X-Git-Tag: upstream/1.9.6^2~326 X-Git-Url: https://git.piment-noir.org/?p=deb_libnfs.git;a=commitdiff_plain;h=41d82d7d825b9b4e73bb227f5b2fafa86067cba0 Merge branch 'win32' into win32-3 --- 41d82d7d825b9b4e73bb227f5b2fafa86067cba0 diff --cc lib/libnfs-sync.c index 510772f,3d3692b..cfeb575 --- a/lib/libnfs-sync.c +++ b/lib/libnfs-sync.c @@@ -22,21 -39,10 +39,17 @@@ #include #include #include - #include #include #include - #include - #include - #include #include #include +#include +#include +#include +#include +#ifdef HAVE_SYS_SOCKIO_H +#include +#endif #include "libnfs.h" #include "libnfs-raw.h" #include "libnfs-raw-mount.h" diff --cc lib/libnfs.c index 7537235,df8ae80..eee5d5a --- a/lib/libnfs.c +++ b/lib/libnfs.c @@@ -1651,13 -1663,13 +1663,13 @@@ int nfs_unlink_async(struct nfs_contex */ static void nfs_opendir_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data) { - READDIR3res *res; + READDIRPLUS3res *res; struct nfs_cb_data *data = private_data; struct nfs_context *nfs = data->nfs; - struct nfsdir *nfsdir = data->continue_data;; + struct nfsdir *nfsdir = data->continue_data; - struct entry3 *entry; + struct entryplus3 *entry; uint64_t cookie; - + if (status == RPC_STATUS_ERROR) { data->cb(-EFAULT, nfs, command_data, data->private_data); nfs_free_nfsdir(nfsdir); @@@ -3082,3 -3082,35 +3095,36 @@@ const char *nfs_get_server(struct nfs_c const char *nfs_get_export(struct nfs_context *nfs) { return nfs->export; } + + + #if defined(WIN32) + int poll(struct pollfd *fds, int nfsd, int timeout) + { + fd_set rfds, wfds, efds; + int ret; + + FD_ZERO(&rfds); + FD_ZERO(&wfds); + FD_ZERO(&efds); + if (fds->events & POLLIN) { + FD_SET(fds->fd, &rfds); + } + if (fds->events & POLLOUT) { + FD_SET(fds->fd, &wfds); + } + FD_SET(fds->fd, &efds); + select(fds->fd + 1, &rfds, &wfds, &efds, NULL); + fds->revents = 0; + if (FD_ISSET(fds->fd, &rfds)) { + fds->revents |= POLLIN; + } + if (FD_ISSET(fds->fd, &wfds)) { + fds->revents |= POLLOUT; + } + if (FD_ISSET(fds->fd, &efds)) { + fds->revents |= POLLHUP; + } ++ return 1; + } + #endif + diff --cc lib/socket.c index e96636a,4d4859e..e9c103e --- a/lib/socket.c +++ b/lib/socket.c @@@ -30,14 -43,7 +43,10 @@@ #ifdef HAVE_SYS_FILIO_H #include #endif +#ifdef HAVE_SYS_SOCKIO_H +#include +#endif - #include #include - #include - #include #include "libnfs.h" #include "libnfs-raw.h" #include "libnfs-private.h"