summaryrefslogtreecommitdiff
path: root/src/lib/shm_rdrbuff.c
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2017-02-07 10:35:49 +0000
committerSander Vrijders <[email protected]>2017-02-07 10:35:49 +0000
commit1bf2dd6aef3af6c81794c0551278373e44310b5c (patch)
tree2c5bb331021e0b15eb43827d05cd06082b6c8edb /src/lib/shm_rdrbuff.c
parent129d5e06d627346cb30ce60cdf43f8a1ae023dcb (diff)
parentd64f05e8bf1277132b648bda2e1175ad8c1d2d5c (diff)
downloadouroboros-1bf2dd6aef3af6c81794c0551278373e44310b5c.tar.gz
ouroboros-1bf2dd6aef3af6c81794c0551278373e44310b5c.zip
Merged in dstaesse/ouroboros/be-wip (pull request #362)
ipcpd, lib: Revise normal IPCP
Diffstat (limited to 'src/lib/shm_rdrbuff.c')
-rw-r--r--src/lib/shm_rdrbuff.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/lib/shm_rdrbuff.c b/src/lib/shm_rdrbuff.c
index ce81d171..55047aa5 100644
--- a/src/lib/shm_rdrbuff.c
+++ b/src/lib/shm_rdrbuff.c
@@ -619,28 +619,20 @@ uint8_t * shm_du_buff_tail_alloc(struct shm_du_buff * sdb,
return buf;
}
-int shm_du_buff_head_release(struct shm_du_buff * sdb,
- size_t size)
+void shm_du_buff_head_release(struct shm_du_buff * sdb,
+ size_t size)
{
assert(sdb);
-
- if (size > sdb->du_tail - sdb->du_head)
- return -EOVERFLOW;
+ assert(!(size > sdb->du_tail - sdb->du_head));
sdb->du_head += size;
-
- return 0;
}
-int shm_du_buff_tail_release(struct shm_du_buff * sdb,
- size_t size)
+void shm_du_buff_tail_release(struct shm_du_buff * sdb,
+ size_t size)
{
assert(sdb);
-
- if (size > sdb->du_tail - sdb->du_head)
- return -EOVERFLOW;
+ assert(!(size > sdb->du_tail - sdb->du_head));
sdb->du_tail -= size;
-
- return 0;
}