aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2020-01-13 17:00:27 -0500
committerRuss Cox <rsc@swtch.com>2020-01-13 17:00:58 -0500
commit369923f6fca5a713698dbac76c486ddb28f43721 (patch)
tree393d1a311dcad436ebae033bf31508a3ec97165f /src
parent93f9789c048d9bfd75192adce3ed9a3ff8a68fbc (diff)
downloadplan9port-369923f6fca5a713698dbac76c486ddb28f43721.tar.gz
plan9port-369923f6fca5a713698dbac76c486ddb28f43721.tar.bz2
plan9port-369923f6fca5a713698dbac76c486ddb28f43721.zip
libthread: fix nbrecvul, recvul to match man page, Plan 9
They return 0 on failure, not -1. Bug introduced in my original libthread-for-Unix code. Fixes #230.
Diffstat (limited to 'src')
-rw-r--r--src/libthread/channel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libthread/channel.c b/src/libthread/channel.c
index b6b2e3e6..53af86e6 100644
--- a/src/libthread/channel.c
+++ b/src/libthread/channel.c
@@ -397,7 +397,7 @@ chanrecvul(Channel *c)
if(_chanop(c, CHANRCV, &val, 1) > 0)
return val;
- return -1;
+ return 0;
}
int
@@ -413,5 +413,5 @@ channbrecvul(Channel *c)
if(_chanop(c, CHANRCV, &val, 0) > 0)
return val;
- return -1;
+ return 0;
}