Remember if lseek works in this FD.

It will be used in clang in a sec.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234619 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2015-04-10 18:15:51 +00:00
parent 139eb5f512
commit e37b898edb
2 changed files with 6 additions and 1 deletions

View File

@@ -525,7 +525,8 @@ raw_fd_ostream::raw_fd_ostream(int fd, bool shouldClose, bool unbuffered)
// Get the starting position.
off_t loc = ::lseek(FD, 0, SEEK_CUR);
if (loc == (off_t)-1)
SupportsSeeking = loc != (off_t)-1;
if (!SupportsSeeking)
pos = 0;
else
pos = static_cast<uint64_t>(loc);