diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-01-22 02:32:32 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-01-22 02:32:32 -0800 |
| commit | b93d5759c9b39ff153a14d474d800cd981f7dc97 (patch) | |
| tree | 1a98b7ac74cd91003c38f53ae3eb01fb8027deef /src/platform/posix | |
| parent | 769f9a2b66aca629eb4dd240a072849a48aa300f (diff) | |
| download | nng-b93d5759c9b39ff153a14d474d800cd981f7dc97.tar.gz nng-b93d5759c9b39ff153a14d474d800cd981f7dc97.tar.bz2 nng-b93d5759c9b39ff153a14d474d800cd981f7dc97.zip | |
Event notification via pollable FDs verified working.
Diffstat (limited to 'src/platform/posix')
| -rw-r--r-- | src/platform/posix/posix_pipe.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/platform/posix/posix_pipe.c b/src/platform/posix/posix_pipe.c index 7f6a50cc..28cd909c 100644 --- a/src/platform/posix/posix_pipe.c +++ b/src/platform/posix/posix_pipe.c @@ -84,8 +84,8 @@ nni_plat_pipe_open(int *wfd, int *rfd) if (pipe(fds) < 0) { return (nni_plat_errno(errno)); } - *wfd = fds[0]; - *rfd = fds[1]; + *wfd = fds[1]; + *rfd = fds[0]; (void) fcntl(fds[0], F_SETFD, FD_CLOEXEC); (void) fcntl(fds[1], F_SETFD, FD_CLOEXEC); @@ -101,7 +101,7 @@ nni_plat_pipe_raise(int wfd) { char c = 1; - write(wfd, &c, 1); + (void) write(wfd, &c, 1); } @@ -109,6 +109,7 @@ void nni_plat_pipe_clear(int rfd) { char buf[32]; + int rv; for (;;) { // Completely drain the pipe, but don't wait. This coalesces |
