diff --git a/src/libsystemd/sd-journal/mmap-cache.c b/src/libsystemd/sd-journal/mmap-cache.c index 6c2c26fde8..992bf1c4fc 100644 --- a/src/libsystemd/sd-journal/mmap-cache.c +++ b/src/libsystemd/sd-journal/mmap-cache.c @@ -551,6 +551,8 @@ int mmap_cache_add_fd(MMapCache *m, int fd, int prot, MMapFileDescriptor **ret) existing = hashmap_get(m->fds, FD_TO_PTR(fd)); if (existing) { + if (existing->prot != prot) + return -EEXIST; if (ret) *ret = existing; return 0;