mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:29:58 +00:00
Fix SupportsSeeking detection on windows.
Will be tested by existing tests once used (soon). llvm-svn: 234737
This commit is contained in:
parent
e206f50870
commit
f087ddcbc4
@ -525,7 +525,14 @@ raw_fd_ostream::raw_fd_ostream(int fd, bool shouldClose, bool unbuffered)
|
||||
|
||||
// Get the starting position.
|
||||
off_t loc = ::lseek(FD, 0, SEEK_CUR);
|
||||
#ifdef LLVM_ON_WIN32
|
||||
// MSVCRT's _lseek(SEEK_CUR) doesn't return -1 for pipes.
|
||||
sys::fs::file_status Status;
|
||||
std::error_code EC = status(FD, Status);
|
||||
SupportsSeeking = !EC && Status.type() == sys::fs::file_type::regular_file;
|
||||
#else
|
||||
SupportsSeeking = loc != (off_t)-1;
|
||||
#endif
|
||||
if (!SupportsSeeking)
|
||||
pos = 0;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user