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.
This commit is contained in:
Russ Cox 2020-01-13 17:00:27 -05:00
parent 93f9789c04
commit 369923f6fc

View file

@ -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;
}