Fix blatantly wrong SetFilePointer() calls.
This commit is contained in:
parent
94c02fef1a
commit
51c38cc729
|
@ -605,7 +605,7 @@ int _locking(int fd, int mode, LONG nbytes)
|
|||
(mode==_LK_NBRLCK)?"_LK_NBRLCK":
|
||||
"UNKNOWN");
|
||||
|
||||
if ((cur_locn = SetFilePointer(hand, 0L, NULL, SEEK_CUR)) == 0xffffffff)
|
||||
if ((cur_locn = SetFilePointer(hand, 0L, NULL, SEEK_CUR)) == INVALID_SET_FILE_POINTER)
|
||||
{
|
||||
FIXME ("Seek failed\n");
|
||||
*MSVCRT__errno() = MSVCRT_EINVAL; /* FIXME */
|
||||
|
|
|
@ -110,7 +110,8 @@ STORAGE_get_big_block(HANDLE hf,int n,BYTE *block)
|
|||
DWORD result;
|
||||
|
||||
assert(n>=-1);
|
||||
if (!SetFilePointer( hf, (n+1)*BIGSIZE, NULL, SEEK_SET ))
|
||||
if ((SetFilePointer( hf, (n+1)*BIGSIZE, NULL,
|
||||
SEEK_SET ) == INVALID_SET_FILE_POINTER) && GetLastError())
|
||||
{
|
||||
WARN(" seek failed (%ld)\n",GetLastError());
|
||||
return FALSE;
|
||||
|
@ -132,9 +133,10 @@ STORAGE_put_big_block(HANDLE hf,int n,BYTE *block)
|
|||
DWORD result;
|
||||
|
||||
assert(n>=-1);
|
||||
if (!SetFilePointer( hf, (n+1)*BIGSIZE, NULL, SEEK_SET ))
|
||||
if ((SetFilePointer( hf, (n+1)*BIGSIZE, NULL,
|
||||
SEEK_SET ) == INVALID_SET_FILE_POINTER) && GetLastError())
|
||||
{
|
||||
WARN(" seek failed (%ld)\n",GetLastError());
|
||||
WARN("seek failed (%ld)\n",GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
if (!WriteFile( hf, block, BIGSIZE, &result, NULL ) || result != BIGSIZE)
|
||||
|
|
Loading…
Reference in New Issue