projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
43254e8
)
Forgotten part of an earlier mismerge
author
Matthias Clasen
<mclasen@redhat.com>
Wed, 21 Sep 2011 19:46:24 +0000
(15:46 -0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Wed, 21 Sep 2011 19:47:26 +0000
(15:47 -0400)
This is making gmappedfile.c identical to the glib-2-30 branch again.
glib/gmappedfile.c
patch
|
blob
|
history
diff --git
a/glib/gmappedfile.c
b/glib/gmappedfile.c
index
6e372c4
..
f94bf31
100644
(file)
--- a/
glib/gmappedfile.c
+++ b/
glib/gmappedfile.c
@@
-178,7
+178,11
@@
g_mapped_file_new (const gchar *filename,
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->contents = NULL;