Skip to content

Commit

Permalink
dtoolutil: Work around odd Linux bug with lseek on a directory fd
Browse files Browse the repository at this point in the history
  • Loading branch information
rdb committed Apr 8, 2021
1 parent ea58bff commit adbbc13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dtoolutil/pandaFileStreamBuf.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ seekoff(streamoff off, ios_seekdir dir, ios_openmode which) {
// Posix case.
{
off_t li = lseek(_fd, off, SEEK_END);
if (li == (off_t)-1) {
if (li == (off_t)-1 || (sizeof(off_t) == 8 && li == 0x7fffffffffffffff)) {
return -1;
}
new_pos = (size_t)li;
Expand Down

0 comments on commit adbbc13

Please sign in to comment.