(Finsert_file_contents): If the file size returned from
stat is zero, set END to READ_BUF_SIZE. This makes sure we can read from files on a procfs whose contents are generated dynamically.
This commit is contained in:
parent
6f26dfa51f
commit
d21dd12d90
1 changed files with 6 additions and 0 deletions
|
@ -3589,6 +3589,12 @@ actually used.")
|
|||
if (XINT (end) != st.st_size
|
||||
|| ((int) st.st_size * 4) / 4 != st.st_size)
|
||||
error ("Maximum buffer size exceeded");
|
||||
|
||||
/* The file size returned from stat may be zero, but data
|
||||
may be readable nonetheless, for example when this is a
|
||||
file in the /proc filesystem. */
|
||||
if (st.st_size == 0)
|
||||
XSETINT (end, READ_BUF_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue