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
c915215b
Commit
c915215b
authored
Apr 09, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use send(2) instead of write(2) for zero-byte writes to sockets.
parent
d5787256
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
mailslot.c
dlls/kernel32/tests/mailslot.c
+1
-1
file.c
dlls/ntdll/file.c
+14
-3
No files found.
dlls/kernel32/tests/mailslot.c
View file @
c915215b
...
...
@@ -258,8 +258,8 @@ static int mailslot_test(void)
dwNext
=
dwMsgCount
=
0
;
ok
(
GetMailslotInfo
(
hSlot
,
NULL
,
&
dwNext
,
&
dwMsgCount
,
NULL
),
"getmailslotinfo failed
\n
"
);
todo_wine
{
ok
(
dwNext
==
0
,
"dwNext incorrect
\n
"
);
todo_wine
{
ok
(
dwMsgCount
==
1
,
"dwMsgCount incorrect
\n
"
);
}
...
...
dlls/ntdll/file.c
View file @
c915215b
...
...
@@ -668,6 +668,7 @@ static void WINAPI FILE_AsyncWriteService(void *ovp, IO_STATUS_BLOCK *iosb, ULON
{
async_fileio
*
fileio
=
(
async_fileio
*
)
ovp
;
int
result
,
fd
,
needs_close
;
enum
server_fd_type
type
;
TRACE
(
"(%p %p 0x%x)
\n
"
,
iosb
,
fileio
->
buffer
,
status
);
...
...
@@ -676,12 +677,16 @@ static void WINAPI FILE_AsyncWriteService(void *ovp, IO_STATUS_BLOCK *iosb, ULON
case
STATUS_ALERTED
:
/* write some data (non-blocking) */
if
((
status
=
server_get_unix_fd
(
fileio
->
handle
,
FILE_WRITE_DATA
,
&
fd
,
&
needs_close
,
NULL
,
NULL
)))
&
needs_close
,
&
type
,
NULL
)))
{
fileio_terminate
(
fileio
,
iosb
,
status
);
break
;
}
result
=
write
(
fd
,
&
fileio
->
buffer
[
fileio
->
already
],
fileio
->
count
-
fileio
->
already
);
if
(
!
fileio
->
count
&&
(
type
==
FD_TYPE_MAILSLOT
||
type
==
FD_TYPE_PIPE
||
type
==
FD_TYPE_SOCKET
))
result
=
send
(
fd
,
fileio
->
buffer
,
0
,
0
);
else
result
=
write
(
fd
,
&
fileio
->
buffer
[
fileio
->
already
],
fileio
->
count
-
fileio
->
already
);
if
(
needs_close
)
close
(
fd
);
if
(
result
<
0
)
...
...
@@ -772,7 +777,13 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent,
for
(;;)
{
if
((
result
=
write
(
unix_handle
,
(
const
char
*
)
buffer
+
total
,
length
-
total
))
>=
0
)
/* zero-length writes on sockets may not work with plain write(2) */
if
(
!
length
&&
(
type
==
FD_TYPE_MAILSLOT
||
type
==
FD_TYPE_PIPE
||
type
==
FD_TYPE_SOCKET
))
result
=
send
(
unix_handle
,
buffer
,
0
,
0
);
else
result
=
write
(
unix_handle
,
(
const
char
*
)
buffer
+
total
,
length
-
total
);
if
(
result
>=
0
)
{
total
+=
result
;
if
(
total
==
length
)
...
...
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