From: Ronnie Sahlberg Date: Sun, 12 Jan 2014 23:18:59 +0000 (-0800) Subject: Merge pull request #47 from Memphiz/win32fix3 X-Git-Tag: upstream/1.9.6^2~135 X-Git-Url: https://git.piment-noir.org/?p=deb_libnfs.git;a=commitdiff_plain;h=c9cc77a538b9062f0b00a26019c6658ca003492e;hp=2d22ee96622e0913cbc9c9e66046dd6d1fdfdac4 Merge pull request #47 from Memphiz/win32fix3 [win32] - fixed bad number casting when using libnfs on 64bit win8 syste... --- diff --git a/include/nfsc/libnfs.h b/include/nfsc/libnfs.h index 81750db..388ea78 100644 --- a/include/nfsc/libnfs.h +++ b/include/nfsc/libnfs.h @@ -217,8 +217,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() @@ -242,7 +245,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 ed6cb23..ca8ed37 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -1027,7 +1027,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);