Modify

Opened 8 years ago

Closed 7 years ago

#4218 closed Bugs (fixed)

Bug in linux version of function boost::interprocess::set_file_pointer

Reported by: im.valdik@… Owned by: Ion Gaztañaga
Milestone: Boost 1.45.0 Component: interprocess
Version: Boost 1.44.0 Severity: Problem
Keywords: Cc:

Description

inline bool set_file_pointer(file_handle_t hnd, offset_t off, file_pos_t pos)
{  return off == ::lseek(hnd, off, (int)pos); }

Comparision "off == ::lseek(...)" is correct only if user is setting pointer from the begining of the file 'file_begin'. But if user is setting file pointer to zero from 'file_end' (setting file pointer to the end of file) set_file_pointer function will return false, even if lseek didn't failed.

I think its better to change code to something like this

inline bool set_file_pointer(file_handle_t hnd, offset_t off, file_pos_t pos)
{  return -1 != ::lseek(hnd, off, (int)pos); }

Attachments (0)

Change History (1)

comment:1 Changed 7 years ago by Ion Gaztañaga

Milestone: Boost 1.43.0Boost-1.45.0
Resolution: fixed
Status: newclosed

Fixed for Boost 1.45 in release branch

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ion Gaztañaga.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.