diff options
author | Steve Huston <shuston@riverace.com> | 2007-02-19 21:05:07 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2007-02-19 21:05:07 +0000 |
commit | f92985f1ec20b251eeea62aca6eab6b7d9167469 (patch) | |
tree | 7efe23287b8d960dba158b225a32f7e3baf4c6c7 /ACE/ace/OS_NS_unistd.inl | |
parent | 8ecffef8fdb7b35419a540a8e8f12a3149e01064 (diff) | |
download | ATCD-f92985f1ec20b251eeea62aca6eab6b7d9167469.tar.gz |
ChangeLogTag:Mon Feb 19 21:02:55 UTC 2007 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ACE/ace/OS_NS_unistd.inl')
-rw-r--r-- | ACE/ace/OS_NS_unistd.inl | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/ACE/ace/OS_NS_unistd.inl b/ACE/ace/OS_NS_unistd.inl index a63620857ad..109acfab208 100644 --- a/ACE/ace/OS_NS_unistd.inl +++ b/ACE/ace/OS_NS_unistd.inl @@ -669,18 +669,20 @@ ACE_OS::llseek (ACE_HANDLE handle, ACE_LOFF_T offset, int whence) ? new_file_pointer.QuadPart : static_cast<ACE_LOFF_T> (-1)); # else - LONG low_offset = ACE_LOW_PART(offset); - LONG high_offset = ACE_HIGH_PART(offset); - - ACE_OFF_T const result = ::SetFilePointer (handle, - low_offset, - &high_offset, - whence); - - return - ((result != INVALID_SET_FILE_POINTER || GetLastError () == NO_ERROR) - ? result - : static_cast<ACE_LOFF_T> (-1)); + LARGE_INTEGER l_offset; + l_offset.QuadPart = offset; + LONG low_offset = l_offset.LowPart; + LONG high_offset = l_offset.HighPart; + + l_offset.LowPart = ::SetFilePointer (handle, + low_offset, + &high_offset, + whence); + if (l_offset.LowPart == INVALID_SET_FILE_POINTER && + GetLastError () != NO_ERROR) + return static_cast<ACE_LOFF_T> (-1); + l_offset.HighPart = high_offset; + return l_offset.QuadPart; # endif /* ACE_LACKS_SETFILEPOINTEREX */ # else ACE_OSCALL_RETURN (::llseek (handle, offset, whence), ACE_LOFF_T, -1); |