Don't fail to read a file because it's non-seekable (e.g., a pipe).

* src/util.c (fread_file_lim): New function.
(__virFileReadAll): Use fread_file_lim, rather than requiring
that stat.st_size provide a usable file size.
* tests/read-non-seekable: New test, for the above.
* tests/Makefile.am (test_scripts): Add read-non-seekable.
* tests/test-lib.sh (mkfifo_or_skip_): New helper function.
This commit is contained in:
Jim Meyering
2008-04-08 15:33:16 +00:00
parent 407df0f164
commit 3ce465f819
5 changed files with 137 additions and 32 deletions

View File

@@ -46,6 +46,7 @@ noinst_PROGRAMS = xmlrpctest xml2sexprtest sexpr2xmltest virshtest conftest \
test_scripts = \
daemon-conf \
int-overflow \
read-non-seekable \
vcpupin
EXTRA_DIST += $(test_scripts)