Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From ff5978e069dbd100aac3d839a4de5ea748c116e3 Mon Sep 17 00:00:00 2001
- From: Memphiz <memphis@machzwo.de>
- Date: Sat, 11 Jan 2014 20:12:39 +0100
- Subject: [PATCH] [nfs] - try to fix the stat struct size on windows and force
- it to 64bi - try to fix the stat struct size on windows and
- force it to 64bitt
- ---
- include/nfsc/libnfs.h | 4 ++++
- lib/libnfs-sync.c | 9 ++++++++-
- lib/libnfs.c | 2 +-
- 3 files changed, 13 insertions(+), 2 deletions(-)
- diff --git a/include/nfsc/libnfs.h b/include/nfsc/libnfs.h
- index 094de3c..b8a72e9 100644
- --- a/include/nfsc/libnfs.h
- +++ b/include/nfsc/libnfs.h
- @@ -169,7 +169,11 @@ EXTERN int nfs_stat_async(struct nfs_context *nfs, const char *path, nfs_cb cb,
- * 0 : The operation was successfull.
- * -errno : The command failed.
- */
- + #ifdef WIN32
- +EXTERN int nfs_stat(struct nfs_context *nfs, const char *path, struct __stat64 *st);
- +#else
- EXTERN int nfs_stat(struct nfs_context *nfs, const char *path, struct stat *st);
- +#endif
- /*
- diff --git a/lib/libnfs-sync.c b/lib/libnfs-sync.c
- index 7de245f..47772ba 100644
- --- a/lib/libnfs-sync.c
- +++ b/lib/libnfs-sync.c
- @@ -208,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;
- }
- -
- +#ifdef WIN32
- memcpy(cb_data->return_data, data, sizeof(struct stat));
- +#else
- + memcpy(cb_data->return_data, data, sizeof(struct __stat64));
- +#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)
- +#endif
- {
- struct sync_cb_data cb_data;
- diff --git a/lib/libnfs.c b/lib/libnfs.c
- index f8b294a..f60ac8d 100644
- --- a/lib/libnfs.c
- +++ b/lib/libnfs.c
- @@ -713,7 +713,7 @@ static void nfs_stat_1_cb(struct rpc_context *rpc, int status, void *command_dat
- GETATTR3res *res;
- struct nfs_cb_data *data = private_data;
- struct nfs_context *nfs = data->nfs;
- - struct stat st;
- + struct __stat64 st;
- assert(rpc->magic == RPC_CONTEXT_MAGIC);
- --
- 1.7.6.msysgit.0
- diff --git a/xbmc/filesystem/NFSFile.cpp b/xbmc/filesystem/NFSFile.cpp
- index 36f9115..e116ab0 100644
- --- a/xbmc/filesystem/NFSFile.cpp
- +++ b/xbmc/filesystem/NFSFile.cpp
- @@ -582,7 +582,7 @@ int CNFSFile::Stat(const CURL& url, struct __stat64* buffer)
- return -1;
- - struct stat tmpBuffer = {0};
- + struct __stat64 tmpBuffer = {0};
- ret = gNfsConnection.GetImpl()->nfs_stat(gNfsConnection.GetNfsContext(), filename.c_str(), &tmpBuffer);
- @@ -594,7 +594,7 @@ int CNFSFile::Stat(const CURL& url, struct __stat64* buffer)
- }
- else
- {
- - if(buffer)
- + /*if(buffer)
- {
- memset(buffer, 0, sizeof(struct __stat64));
- buffer->st_dev = tmpBuffer.st_dev;
- @@ -608,7 +608,8 @@ int CNFSFile::Stat(const CURL& url, struct __stat64* buffer)
- buffer->st_atime = tmpBuffer.st_atime;
- buffer->st_mtime = tmpBuffer.st_mtime;
- buffer->st_ctime = tmpBuffer.st_ctime;
- - }
- + }*/
- + memcpy(buffer, &tmpBuffer, sizeof(struct __stat64));
- }
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement