mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-04 06:43:07 +02:00
Forgotten part of an earlier mismerge
This is making gmappedfile.c identical to the glib-2-30 branch again.
This commit is contained in:
parent
43254e8c4c
commit
c6f84faa17
@ -178,7 +178,11 @@ g_mapped_file_new (const gchar *filename,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (st.st_size == 0)
|
/* mmap() on size 0 will fail with EINVAL, so we avoid calling mmap()
|
||||||
|
* in that case -- but only if we have a regular file; we still want
|
||||||
|
* attempts to mmap a character device to fail, for example.
|
||||||
|
*/
|
||||||
|
if (st.st_size == 0 && S_ISREG (st.st_mode))
|
||||||
{
|
{
|
||||||
file->length = 0;
|
file->length = 0;
|
||||||
file->contents = NULL;
|
file->contents = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user