… | |
… | |
4 | /* WARNING |
4 | /* WARNING |
5 | * This header file is a shared resource between many modules. |
5 | * This header file is a shared resource between many modules. |
6 | */ |
6 | */ |
7 | |
7 | |
8 | #include <signal.h> |
8 | #include <signal.h> |
|
|
9 | #include <errno.h> |
9 | |
10 | |
10 | #ifndef _WIN32 |
11 | #ifndef _WIN32 |
11 | # include <poll.h> |
12 | # include <poll.h> |
12 | #endif |
13 | #endif |
13 | |
14 | |
… | |
… | |
401 | */ |
402 | */ |
402 | DWORD dummy; |
403 | DWORD dummy; |
403 | WriteFile (S_TO_HANDLE (epp->fd [1]), (LPCVOID)&dummy, 1, &dummy, 0); |
404 | WriteFile (S_TO_HANDLE (epp->fd [1]), (LPCVOID)&dummy, 1, &dummy, 0); |
404 | #else |
405 | #else |
405 | static uint64_t counter = 1; |
406 | static uint64_t counter = 1; |
|
|
407 | /* some modules accept fd's from outside, support eventfd here */ |
|
|
408 | if (write (epp->fd [1], &counter, epp->len) < 0 |
|
|
409 | && errno == EINVAL |
|
|
410 | && epp->len != 8) |
406 | write (epp->fd [1], &counter, epp->len); |
411 | write (epp->fd [1], &counter, (epp->len = 8)); |
407 | #endif |
412 | #endif |
408 | } |
413 | } |
409 | } |
414 | } |
410 | |
415 | |
411 | static void |
416 | static void |