repositories
/
deb_libnfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure cookie is initialized before we use it.
[deb_libnfs.git]
/
lib
/
libnfs-sync.c
diff --git
a/lib/libnfs-sync.c
b/lib/libnfs-sync.c
index fe711ac5f58ccce6656c93356242a869f5adeb9a..baadefa9962df6482ab938823b0da3a51d576c9d 100644
(file)
--- a/
lib/libnfs-sync.c
+++ b/
lib/libnfs-sync.c
@@
-17,37
+17,62
@@
/*
* High level api to nfs filesystems
*/
/*
* High level api to nfs filesystems
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef AROS
+#include "aros_compat.h"
+#endif
+
#ifdef WIN32
#include "win32_compat.h"
#ifdef WIN32
#include "win32_compat.h"
-#else
-#include <strings.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <netdb.h>
-#include <sys/socket.h>
+#endif
+
+#ifdef HAVE_NET_IF_H
#include <net/if.h>
#include <net/if.h>
+#endif
-#ifdef AROS
-#include "aros_compat.h"
-#else
#ifdef ANDROID
#ifdef ANDROID
-#include <netinet/in.h>
-#include <sys/vfs.h>
#define statvfs statfs
#define statvfs statfs
-#else
+#endif
+
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+
+#ifdef HAVE_SYS_STATVFS_H
#include <sys/statvfs.h>
#include <sys/statvfs.h>
-#endif /*ANDRIOD*/
-#endif /*AROS*/
-#endif /*WIN32*/
+#endif
-#ifdef HAVE_CONFIG_H
-#include "config.h"
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
#endif
#ifdef HAVE_POLL_H
#include <poll.h>
#endif
#endif
#ifdef HAVE_POLL_H
#include <poll.h>
#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@
-183,11
+208,18
@@
static void stat_cb(int status, struct nfs_context *nfs, void *data, void *priva
nfs_set_error(nfs, "stat call failed with \"%s\"", (char *)data);
return;
}
nfs_set_error(nfs, "stat call failed with \"%s\"", (char *)data);
return;
}
-
- memcpy(cb_data->return_data, data, sizeof(struct stat));
+#ifdef WIN32
+ memcpy(cb_data->return_data, data, sizeof(struct __stat64));
+#else
+ memcpy(cb_data->return_data, data, sizeof(struct stat));
+#endif
}
}
+#ifdef WIN32
+int nfs_stat(struct nfs_context *nfs, const char *path, struct __stat64 *st)
+#else
int nfs_stat(struct nfs_context *nfs, const char *path, struct stat *st)
int nfs_stat(struct nfs_context *nfs, const char *path, struct stat *st)
+#endif
{
struct sync_cb_data cb_data;
{
struct sync_cb_data cb_data;