summaryrefslogtreecommitdiff
path: root/src/lib/dev.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2017-10-30 13:01:25 +0100
committerSander Vrijders <sander.vrijders@ugent.be>2017-10-30 13:54:02 +0100
commit81cc401a4ef05a6bc5bcbda5ad27f8a60706aa02 (patch)
tree8f3e48b2b37d79d737afc83c403eaaa86e14b59e /src/lib/dev.c
parentf9cf89d54f0d1661fd78f778d0bdb4812f3bd460 (diff)
downloadouroboros-81cc401a4ef05a6bc5bcbda5ad27f8a60706aa02.tar.gz
ouroboros-81cc401a4ef05a6bc5bcbda5ad27f8a60706aa02.zip
dev: Split nonblocking read and write
The FLOWFNONBLOCK flag now has two subflags FLOWFRNOBLOCK and FLOWFWNOBLOCK which allows setting the behavior of read and write independently. The default behavior is unchanged (blocking read and write). Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'src/lib/dev.c')
-rw-r--r--src/lib/dev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c
index 11ab645d..28a99bc4 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -430,7 +430,7 @@ static ssize_t frcti_read(int fd)
pthread_rwlock_rdlock(&ai.lock);
- noblock = ai.flows[fd].oflags & FLOWFNONBLOCK;
+ noblock = ai.flows[fd].oflags & FLOWFRNOBLOCK;
rb = ai.flows[fd].rx_rb;
if (ai.flows[fd].rcv_timesout) {
@@ -1096,7 +1096,7 @@ ssize_t flow_write(int fd,
return -EPERM;
}
- if (ai.flows[fd].oflags & FLOWFNONBLOCK) {
+ if (ai.flows[fd].oflags & FLOWFWNOBLOCK) {
idx = shm_rdrbuff_write(ai.rdrb,
DU_BUFF_HEADSPACE,
DU_BUFF_TAILSPACE,