Mail Archives: djgpp-workers/2000/11/27/07:15:47
Eli said:
> On Mon, 27 Nov 2000, Peter J. Farley III wrote:
> > + case F_SETLKW:
> > + {
> > + struct flock *lock_req = NULL; /* shut up -Wall */
> > + int ret = -1;
> > + off_t pos, cur_pos, lock_pos;
> > + off_t len;
> > +
> > +
> > + cur_pos = lseek(fd, 0, SEEK_CUR);
>
> This should check if cur_pos is -1, and if so, bail out. This might
> happen, e.g., if fd is invalid.
Not to mention the case of FAT32 and overflowing the off_t type. I
suggest you use offset_t and llseek().
Is there somewhere we can put such DJGPP developing niceties (Do not
use lseek() and off_t in libc. Use llseek() and offset_t instead.)?
Right,
MartinS
- Raw text -