diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2021-06-30 11:25:07 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2021-06-30 11:25:07 +0000 |
commit | 6c7a5b92bdfe68e847d371cc41f6655df3ef1ba5 (patch) | |
tree | 94515f79ddde39bfcb5514a263a320bf374fa6d2 /src/libstddjb/cdb_init.c | |
parent | e0bc74ff013a3628b17911be624d17067259c07b (diff) | |
download | skalibs-6c7a5b92bdfe68e847d371cc41f6655df3ef1ba5.tar.xz |
bugfix: offset in cdb mmap
An offset of -1 worked because most OSes treat it as 0,
but DS9k would fail on it.
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libstddjb/cdb_init.c')
-rw-r--r-- | src/libstddjb/cdb_init.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstddjb/cdb_init.c b/src/libstddjb/cdb_init.c index 2a1ffb3..8b56c1a 100644 --- a/src/libstddjb/cdb_init.c +++ b/src/libstddjb/cdb_init.c @@ -15,7 +15,7 @@ int cdb_init (struct cdb *c, int fd) char *map ; if (fstat(fd, &st) < 0) return -1 ; if (st.st_size > UINT32_MAX) return (errno = EOVERFLOW, -1) ; - map = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, -1) ; + map = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0) ; if (map == MAP_FAILED) return -1 ; c->map = map ; c->size = st.st_size ; |