Skip to content

Commit

Permalink
add patch from lxf
Browse files Browse the repository at this point in the history
  • Loading branch information
Jowen committed Jun 14, 2018
1 parent edcab12 commit 1ba02fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/database/mman-win32/mman.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ int ftruncate(int fd, oft__ size)
big.QuadPart = (LONGLONG)size;

const HANDLE handle = (HANDLE)_get_osfhandle(fd);
const position = SetFilePointerEx(handle, big, NULL, FILE_BEGIN);
const BOOL ret = SetFilePointerEx(handle, big, NULL, FILE_BEGIN);

if (position == INVALID_SET_FILE_POINTER || SetEndOfFile(handle) == FALSE)
if (!ret || !SetEndOfFile(handle))
{
const DWORD error = GetLastError();

Expand Down

0 comments on commit 1ba02fa

Please sign in to comment.