mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 956961 - FileDescriptorToFILE should always use its input. r=bent
--HG-- extra : amend_source : 60d5d0ca9a9dd57c66e7a250f6f8604820357131
This commit is contained in:
parent
2e07a29997
commit
b6750e3e4d
@ -91,11 +91,13 @@ FILE*
|
|||||||
FileDescriptorToFILE(const FileDescriptor& aDesc,
|
FileDescriptorToFILE(const FileDescriptor& aDesc,
|
||||||
const char* aOpenMode)
|
const char* aOpenMode)
|
||||||
{
|
{
|
||||||
|
// Debug builds check whether the handle was "used", even if it's
|
||||||
|
// invalid, so that needs to happen first.
|
||||||
|
FileDescriptor::PlatformHandleType handle = aDesc.PlatformHandle();
|
||||||
if (!aDesc.IsValid()) {
|
if (!aDesc.IsValid()) {
|
||||||
errno = EBADF;
|
errno = EBADF;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
FileDescriptor::PlatformHandleType handle = aDesc.PlatformHandle();
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
int fd = _open_osfhandle(reinterpret_cast<intptr_t>(handle), 0);
|
int fd = _open_osfhandle(reinterpret_cast<intptr_t>(handle), 0);
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user