projects
/
oweals
/
tinc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
92d6649
)
WSAEVENT is a pointer, so we cannot simply return the different of two
author
Todd C. Miller
<Todd.Miller@sudo.ws>
Tue, 23 Jan 2018 22:57:58 +0000
(15:57 -0700)
committer
Todd C. Miller
<Todd.Miller@sudo.ws>
Tue, 23 Jan 2018 22:57:58 +0000
(15:57 -0700)
events in io_compare(), which returns an int. This can return the wrong
result for 64-bit executables.
src/event.c
patch
|
blob
|
history
diff --git
a/src/event.c
b/src/event.c
index 5edd3a6d0b7cf8efbef2100ba43012085ac5639d..84b18b3d3f5c31cde79acf75f49d48bf601850ed 100644
(file)
--- a/
src/event.c
+++ b/
src/event.c
@@
-41,7
+41,13
@@
static int io_compare(const io_t *a, const io_t *b) {
#ifndef HAVE_MINGW
return a->fd - b->fd;
#else
- return a->event - b->event;
+ if(a->event < b->event) {
+ return -1;
+ }
+ if(a->event > b->event) {
+ return 1;
+ }
+ return 0;
#endif
}