… | |
… | |
440 | * incompetent windows programmers - is this redundant? |
440 | * incompetent windows programmers - is this redundant? |
441 | */ |
441 | */ |
442 | DWORD dummy; |
442 | DWORD dummy; |
443 | WriteFile (S_TO_HANDLE (epp->fd [1]), (LPCVOID)&dummy, 1, &dummy, 0); |
443 | WriteFile (S_TO_HANDLE (epp->fd [1]), (LPCVOID)&dummy, 1, &dummy, 0); |
444 | #else |
444 | #else |
445 | # if SCHMORP_H_HAVE_EVENTFD |
|
|
446 | static uint64_t counter = 1; |
445 | static uint64_t counter = 1; |
447 | # else |
|
|
448 | static char counter [8]; |
|
|
449 | # endif |
|
|
450 | /* some modules accept fd's from outside, support eventfd here */ |
446 | /* some modules accept fd's from outside, support eventfd here */ |
451 | if (write (epp->fd [1], &counter, epp->len) < 0 |
447 | if (write (epp->fd [1], &counter, epp->len) < 0 |
452 | && errno == EINVAL |
448 | && errno == EINVAL |
453 | && epp->len != 8) |
449 | && epp->len != 8) |
454 | write (epp->fd [1], &counter, (epp->len = 8)); |
450 | write (epp->fd [1], &counter, (epp->len = 8)); |