summaryrefslogtreecommitdiff
path: root/src/lib/shm_rbuff.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2023-08-13 17:44:50 +0200
committerSander Vrijders <sander@ouroboros.rocks>2023-08-23 13:09:10 +0200
commit6c66441bded4e0d413ee8aedd98da84169cdf270 (patch)
tree7dc072750daf6a577bd0634e077a3f35177c1217 /src/lib/shm_rbuff.c
parent3b39928f2a29aab3c93283d29cf4ab5e4cf6c16c (diff)
downloadouroboros-6c66441bded4e0d413ee8aedd98da84169cdf270.tar.gz
ouroboros-6c66441bded4e0d413ee8aedd98da84169cdf270.zip
lib: Fix lengths of shared memory objects
Seems like all shared memory objects were truncated to a size that came up a byte short. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/lib/shm_rbuff.c')
-rw-r--r--src/lib/shm_rbuff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/shm_rbuff.c b/src/lib/shm_rbuff.c
index 2e296bf0..c8230108 100644
--- a/src/lib/shm_rbuff.c
+++ b/src/lib/shm_rbuff.c
@@ -90,7 +90,7 @@ static struct shm_rbuff * rbuff_create(pid_t pid,
if (fd == -1)
goto fail_open;
- if ((flags & O_CREAT) && ftruncate(fd, SHM_RB_FILE_SIZE - 1) < 0)
+ if ((flags & O_CREAT) && ftruncate(fd, SHM_RB_FILE_SIZE) < 0)
goto fail_truncate;
shm_base = mmap(NULL, SHM_RB_FILE_SIZE, MM_FLAGS, MAP_SHARED, fd, 0);