diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:09:23 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:09:23 +0000 |
| commit | f73363f1dd94996356cefbf24388f561891acf0b (patch) | |
| tree | e3c31248bdb36eaec5fd833490d4278162dba2a0 /source/Host/common/File.cpp | |
| parent | 160ee69dd7ae18978f4068116777639ea98dc951 (diff) | |
Notes
Diffstat (limited to 'source/Host/common/File.cpp')
| -rw-r--r-- | source/Host/common/File.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/Host/common/File.cpp b/source/Host/common/File.cpp index 6ee4e894756b..3c3d55df2207 100644 --- a/source/Host/common/File.cpp +++ b/source/Host/common/File.cpp @@ -100,7 +100,7 @@ int File::GetDescriptor() const { // Don't open the file descriptor if we don't need to, just get it from the // stream if we have one. if (StreamIsValid()) { -#if defined(LLVM_ON_WIN32) +#if defined(_WIN32) return _fileno(m_stream); #else return fileno(m_stream); @@ -126,8 +126,8 @@ FILE *File::GetStream() { const char *mode = GetStreamOpenModeFromOptions(m_options); if (mode) { if (!m_should_close_fd) { -// We must duplicate the file descriptor if we don't own it because -// when you call fdopen, the stream will own the fd +// We must duplicate the file descriptor if we don't own it because when you +// call fdopen, the stream will own the fd #ifdef _WIN32 m_descriptor = ::_dup(GetDescriptor()); #else @@ -139,8 +139,8 @@ FILE *File::GetStream() { m_stream = llvm::sys::RetryAfterSignal(nullptr, ::fdopen, m_descriptor, mode); - // If we got a stream, then we own the stream and should no - // longer own the descriptor because fclose() will close it for us + // If we got a stream, then we own the stream and should no longer own + // the descriptor because fclose() will close it for us if (m_stream) { m_own_stream = true; @@ -315,7 +315,7 @@ Status File::GetFileSpec(FileSpec &file_spec) const { if (::fcntl(GetDescriptor(), F_GETPATH, path) == -1) error.SetErrorToErrno(); else - file_spec.SetFile(path, false); + file_spec.SetFile(path, false, FileSpec::Style::native); } else { error.SetErrorString("invalid file handle"); } @@ -330,7 +330,7 @@ Status File::GetFileSpec(FileSpec &file_spec) const { error.SetErrorToErrno(); else { path[len] = '\0'; - file_spec.SetFile(path, false); + file_spec.SetFile(path, false, FileSpec::Style::native); } } #else |
