diff options
Diffstat (limited to 'file_io/win32/seek.c')
-rw-r--r-- | file_io/win32/seek.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index f3ac7cf9e..41bc28d4d 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -43,10 +43,16 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) DWORD offhi = (DWORD)(pos >> 32); rc = SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN); - if (rc == 0xFFFFFFFF) + if (rc == INVALID_SET_FILE_POINTER) + /* A legal value, perhaps? MSDN implies prior SetLastError isn't + * needed, googling for SetLastError SetFilePointer seems + * to confirm this. + */ rv = apr_get_os_error(); - else { + else rv = APR_SUCCESS; + + if (rv == APR_SUCCESS) { thefile->eof_hit = thefile->bufpos = thefile->dataRead = 0; thefile->filePtr = pos; } |