Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ea2798f1
Commit
ea2798f1
authored
Aug 03, 2015
by
Iván Matellanes
Committed by
Alexandre Julliard
Aug 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: _setmode should check if file descriptor is valid.
parent
e2659db4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
file.c
dlls/msvcrt/file.c
+5
-0
file.c
dlls/msvcrt/tests/file.c
+10
-0
No files found.
dlls/msvcrt/file.c
View file @
ea2798f1
...
...
@@ -2833,6 +2833,11 @@ int CDECL MSVCRT__setmode(int fd,int mode)
return
-
1
;
}
if
(
info
==
&
MSVCRT___badioinfo
)
{
*
MSVCRT__errno
()
=
MSVCRT_EBADF
;
return
-
1
;
}
if
(
mode
==
MSVCRT__O_BINARY
)
{
info
->
wxflag
&=
~
WX_TEXT
;
info
->
exflag
&=
~
(
EF_UTF8
|
EF_UTF16
);
...
...
dlls/msvcrt/tests/file.c
View file @
ea2798f1
...
...
@@ -1789,6 +1789,16 @@ static void test_setmode(void)
return
;
}
errno
=
0xdeadbeef
;
ret
=
_setmode
(
-
2
,
0
);
ok
(
ret
==
-
1
,
"_setmode returned %x, expected -1
\n
"
,
ret
);
ok
(
errno
==
EINVAL
,
"errno = %d
\n
"
,
errno
);
errno
=
0xdeadbeef
;
ret
=
_setmode
(
-
2
,
_O_TEXT
);
ok
(
ret
==
-
1
,
"_setmode returned %x, expected -1
\n
"
,
ret
);
ok
(
errno
==
EBADF
,
"errno = %d
\n
"
,
errno
);
fd
=
_open
(
name
,
_O_CREAT
|
_O_WRONLY
,
_S_IWRITE
);
ok
(
fd
!=
-
1
,
"failed to open file
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment