From: Memphiz Date: Sun, 12 Jan 2014 13:42:56 +0000 (+0100) Subject: [win32] - fixed bad number casting when using libnfs on 64bit win8 systems - force... X-Git-Tag: upstream/1.9.6^2~135^2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=be184101ca7251c15184e6af3880680018011e32;p=deb_libnfs.git [win32] - fixed bad number casting when using libnfs on 64bit win8 systems - force the usage of struct __stat64 as its done on other platforms implicitly --- diff --git a/include/nfsc/libnfs.h b/include/nfsc/libnfs.h index 094de3c..82b4a06 100644 --- a/include/nfsc/libnfs.h +++ b/include/nfsc/libnfs.h @@ -169,8 +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 /* * FSTAT() @@ -194,7 +197,11 @@ EXTERN int nfs_fstat_async(struct nfs_context *nfs, struct nfsfh *nfsfh, nfs_cb * 0 : The operation was successfull. * -errno : The command failed. */ +#ifdef WIN32 +EXTERN int nfs_fstat(struct nfs_context *nfs, struct nfsfh *nfsfh, struct __stat64 *st); +#else EXTERN int nfs_fstat(struct nfs_context *nfs, struct nfsfh *nfsfh, struct stat *st); +#endif diff --git a/lib/libnfs-sync.c b/lib/libnfs-sync.c index 7de245f..baadefa 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; } - - 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) +#endif { struct sync_cb_data cb_data; diff --git a/lib/libnfs.c b/lib/libnfs.c index f8b294a..a1a62bb 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -713,7 +713,11 @@ 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; +#ifdef WIN32 + struct __stat64 st; +#else struct stat st; +#endif assert(rpc->magic == RPC_CONTEXT_MAGIC);