aboutsummaryrefslogtreecommitdiff
path: root/src/platform/posix/posix_pipe.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-22 02:32:32 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-22 02:32:32 -0800
commitb93d5759c9b39ff153a14d474d800cd981f7dc97 (patch)
tree1a98b7ac74cd91003c38f53ae3eb01fb8027deef /src/platform/posix/posix_pipe.c
parent769f9a2b66aca629eb4dd240a072849a48aa300f (diff)
downloadnng-b93d5759c9b39ff153a14d474d800cd981f7dc97.tar.gz
nng-b93d5759c9b39ff153a14d474d800cd981f7dc97.tar.bz2
nng-b93d5759c9b39ff153a14d474d800cd981f7dc97.zip
Event notification via pollable FDs verified working.
Diffstat (limited to 'src/platform/posix/posix_pipe.c')
-rw-r--r--src/platform/posix/posix_pipe.c7
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