Windows: Remove spurious use of CRTL

Checkins b71a2daa and 5247fa38a moved us from using a FILE*
to using an FDi_t.  However, lurking inside the dump code we
see a use of _filelength() which is a MS-Crtl API.

This checkin replaces this call with one to the WIN32 API
GetFileSizeEx.

Change-Id: I6ecc25a52d083f918bd8d92670b05f12e58e4015
Reviewed-on: http://gerrit.openafs.org/5511
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
Rod Widdowson 2011-09-28 16:46:00 +01:00 committed by Jeffrey Altman
parent c7dc0180c7
commit 60a6454d80
2 changed files with 14 additions and 2 deletions

View File

@ -703,6 +703,8 @@ DumpFile(struct iod *iodp, int vnode, FdHandle_t * handleP)
afs_ino_str_t stmp;
#ifndef AFS_NT40_ENV
struct afs_stat status;
#else
LARGE_INTEGER fileSize;
#endif
#ifdef AFS_AIX_ENV
#include <sys/statfs.h>
@ -715,7 +717,11 @@ DumpFile(struct iod *iodp, int vnode, FdHandle_t * handleP)
#endif
#ifdef AFS_NT40_ENV
howBig = _filelength(handleP->fd_fd);
if (!GetFileSizeEx(handleP->fd_fd, &fileSize)) {
Log("DumpFile: GetFileSizeEx returned error code %d on descriptor %d\n", GetLastError(), handleP->fd_fd);
return VOLSERDUMPERROR;
}
howBig = fileSize.QuadPart;
howMany = 4096;
#else

View File

@ -530,6 +530,8 @@ DumpFile(int dumpfd, int vnode, FdHandle_t * handleP, struct VnodeDiskObject *v
afs_ino_str_t stmp;
#ifndef AFS_NT40_ENV
struct afs_stat status;
#else
LARGE_INTEGER fileSize;
#endif
afs_sfsize_t size;
#ifdef AFS_AIX_ENV
@ -541,7 +543,11 @@ DumpFile(int dumpfd, int vnode, FdHandle_t * handleP, struct VnodeDiskObject *v
fprintf(stderr, "dumping file for vnode %d\n", vnode);
#ifdef AFS_NT40_ENV
howBig = _filelength(handleP->fd_fd);
if (!GetFileSizeEx(handleP->fd_fd, &fileSize)) {
Log("DumpFile: GetFileSizeEx returned error code %d on descriptor %d\n", GetLastError(), handleP->fd_fd);
return VOLSERDUMPERROR;
}
howBig = fileSize.QuadPart;
howMany = 4096;
#else