Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
6e72242a
Commit
6e72242a
authored
Jan 07, 2012
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libev: fix evpipe on windows (async watcher)
parent
e94f8881
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
gevent/libev_vfd.h
gevent/libev_vfd.h
+1
-0
libev/ev.c
libev/ev.c
+19
-0
No files found.
gevent/libev_vfd.h
View file @
6e72242a
...
...
@@ -6,6 +6,7 @@
* handles. Then by defining special macros libev
* will use our functions.
*/
#define GEVENT_VFD_MODE
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
...
...
libev/ev.c
View file @
6e72242a
...
...
@@ -1812,12 +1812,27 @@ evpipe_write (EV_P_ EV_ATOMIC_T *flag)
else
#endif
{
#ifdef GEVENT_VFD_MODE
/* in gevent VFD mode, a file descriptor is a meaningless number,
* so we'll convert it to proper Windows handle */
if
(
send
(
EV_FD_TO_WIN32_HANDLE
(
evpipe
[
1
]),
&
(
evpipe
[
1
]),
1
,
0
)
<
0
)
{
#if EV_AVOID_STDIO
ev_printerr
(
"(libev) send error"
);
ev_printerr
(
": "
);
ev_printerr
(
strerror
(
errno
));
ev_printerr
(
"
\n
"
);
#else
perror
(
"(libev) send error"
);
#endif
}
#else
/* win32 people keep sending patches that change this write() to send() */
/* and then run away. but send() is wrong, it wants a socket handle on win32 */
/* so when you think this write should be a send instead, please find out */
/* where your send() is from - it's definitely not the microsoft send, and */
/* tell me. thank you. */
write
(
evpipe
[
1
],
&
(
evpipe
[
1
]),
1
);
#endif
}
errno
=
old_errno
;
...
...
@@ -1843,8 +1858,12 @@ pipecb (EV_P_ ev_io *iow, int revents)
#endif
{
char
dummy
;
#ifdef GEVENT_VFD_MODE
recv
(
EV_FD_TO_WIN32_HANDLE
(
evpipe
[
0
]),
&
dummy
,
1
,
0
);
#else
/* see discussion in evpipe_write when you think this read should be recv in win32 */
read
(
evpipe
[
0
],
&
dummy
,
1
);
#endif
}
}
...
...
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