summaryrefslogtreecommitdiff
path: root/src/lib/shm_rdrbuff.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_rdrbuff.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_rdrbuff.c')
-rw-r--r--src/lib/shm_rdrbuff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/shm_rdrbuff.c b/src/lib/shm_rdrbuff.c
index 46b2a6f7..56ae484e 100644
--- a/src/lib/shm_rdrbuff.c
+++ b/src/lib/shm_rdrbuff.c
@@ -173,7 +173,7 @@ static struct shm_rdrbuff * rdrb_create(int flags)
if (fd == -1)
goto fail_open;
- if ((flags & O_CREAT) && ftruncate(fd, SHM_FILE_SIZE - 1) < 0)
+ if ((flags & O_CREAT) && ftruncate(fd, SHM_FILE_SIZE) < 0)
goto fail_truncate;
shm_base = mmap(NULL, SHM_FILE_SIZE, MM_FLAGS, MAP_SHARED, fd, 0);