From: Alex Riesen <hidden> Date: 2016-06-15 22:42:15
Not that the stat against open race would matter much in this context,
but that simplifies
the code a bit. Also some diagnostics added (why the open failed)
Signed-off-by: Alex Riesen <redacted>
Neat, but perhaps you should check the fstat return code.
It actually can fail, for example if the filesize cannot be represented in the
structure because it is too big.
Morten
From: Alex Riesen <hidden> Date: 2016-06-15 22:42:15
On 1/5/06, Morten Welinder [off-list ref] wrote:
Neat, but perhaps you should check the fstat return code.
It actually can fail, for example if the filesize cannot be represented in the
structure because it is too big.
Yes, of course. It will be added along with the missing test for mmap
returning MAP_FAILED. Sometime.
Sarcasm aside, how do you get such a situation?
Config files always tend to grow, but I do agree that 4GB config files stretches
credibility a bit.
However, empty ones are not unlikely and then mmap will fail.
M.
From: Alex Riesen <hidden> Date: 2016-06-15 22:42:15
Morten Welinder, Thu, Jan 05, 2006 17:45:27 +0100:
Config files always tend to grow, but I do agree that 4GB config files stretches
credibility a bit.
However, empty ones are not unlikely and then mmap will fail.
Shouldn't be a problem: the code in question does not seem to do
anything for empty files and wont even touch the result of mmap.