]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Avoid compiler warning if off_t has the same size as ssize_t.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sat, 13 Aug 2016 11:31:08 +0000 (14:31 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Sat, 13 Aug 2016 11:32:19 +0000 (14:32 +0300)
src/lib/mmap-util.c

index 87807d8e83ba2e32d49d5bba2411a2b5e4634f45..9d160d493047712a3f41adafbf558d51099a6031 100644 (file)
@@ -12,11 +12,13 @@ void *mmap_file(int fd, size_t *length, int prot)
        if (fstat(fd, &st) < 0)
                return MAP_FAILED;
 
+#if OFF_T_MAX > SSIZE_T_MAX
        if (st.st_size > SSIZE_T_MAX) {
                /* too large file to map into memory */
                errno = EFBIG;
                return MAP_FAILED;
        }
+#endif
 
        *length = (size_t)st.st_size;
        if (*length == 0)