Merge branch 'win32' into win32-3
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Sat, 3 Sep 2011 00:57:42 +0000 (10:57 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Sat, 3 Sep 2011 00:57:42 +0000 (10:57 +1000)
1  2 
include/libnfs.h
lib/libnfs-sync.c
lib/libnfs.c
lib/socket.c
nfs/nfs.c

Simple merge
index 510772fa1efe6f7e889ac7af2e7b1277157475a7,3d3692b403ebcf18c1d117b890f3984bb1b50cd9..cfeb5759989ae3835172001e6719efca138758e0
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
- #include <strings.h>
  #include <sys/types.h>
  #include <sys/stat.h>
- #include <sys/statvfs.h>
- #include <sys/ioctl.h>
- #include <unistd.h>
  #include <fcntl.h>
  #include <errno.h>
 +#include <poll.h>
 +#include <sys/socket.h>
 +#include <net/if.h>
 +#include <netdb.h>
 +#ifdef HAVE_SYS_SOCKIO_H
 +#include <sys/sockio.h>
 +#endif
  #include "libnfs.h"
  #include "libnfs-raw.h"
  #include "libnfs-raw-mount.h"
diff --cc lib/libnfs.c
index 75372359f261b6f7dc7b07b0c1ce78e1e4a8f2ee,df8ae802cf6149537c73ced356bff11e8406fa5b..eee5d5a6dbb8e4b6c8f755f7adbe2129289d35e6
@@@ -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 e96636ae7fa4198774ee14e5b2ac8c4e53d703b5,4d4859edf3aa151ad23dea11e0072475870c1ee0..e9c103e55b0cd124ce04baaeef1721fb43d5e5fd
  #ifdef HAVE_SYS_FILIO_H
  #include <sys/filio.h>
  #endif
- #include <sys/ioctl.h>
 +#ifdef HAVE_SYS_SOCKIO_H
 +#include <sys/sockio.h>
 +#endif
  #include <sys/types.h>
- #include <sys/socket.h>
- #include <netdb.h>
  #include "libnfs.h"
  #include "libnfs-raw.h"
  #include "libnfs-private.h"
diff --cc nfs/nfs.c
Simple merge