Download raw body.
track pack file size as off_t and size_t
Stefan Sperling: > With the patch below, we keep separate variables for the on-disk and > memory-mapped sizes which fixes off_t/size_t confusion in some places. > Furthermore, we only attempt to map files which will fit into a size_t. pack.mapsize is oddly redundant. Whether the file is memory-mapped or not is already given by pack.map != NULL. That can be checked directly, rather than pack.mapsize == 0. So pack.mapsize is merely a convenient abbreviation for (size_t)pack.filesize. But where do you actually need the cast? Why not use pack.filesize throughout, and just check pack.filesize < SIZE_MAX before the mmap()? Storing the size twice in adjacent variables is weird. BTW, I guess strictly speaking pack.map == 0 may be a valid address, so I wonder whether MAP_FAILED should be used instead to mark a non-mapping. -- Christian "naddy" Weisgerber naddy@mips.inka.de
track pack file size as off_t and size_t