Re: Better error messages for corrupt databases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Linus Torvalds <torvalds@xxxxxxxx> wrote:
> So this just makes "xmmap()" return NULL for a zero-sized object (which is 
> a valid thing pointer, exactly the same way "malloc()" can return NULL for 
> a zero-sized allocation). That fixes the first problem (but we could have 
> fixed it in the caller too - I don't personally much care whichever way it 
> goes, but maybe somebody should check that the NO_MMAP case does 
> something sane in this case too?).

All calls to perform any sort of mmap go through xmmap().  If NO_MMAP
was defined at compile time than the mmap() call within xmmap() is
redefined to invoke git_mmap() via a preprocessor define slightly
earlier in git-compat-util.h.

So your patch will also automatically do the right thing in the
NO_MMAP case.

BTW, I like your solution of just fixing it here in xmmap().  Good idea.

-- 
Shawn.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]