]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Don't fail to read a file because it's non-seekable (e.g., a pipe).
authorJim Meyering <meyering@redhat.com>
Tue, 8 Apr 2008 15:33:16 +0000 (15:33 +0000)
committerJim Meyering <meyering@redhat.com>
Tue, 8 Apr 2008 15:33:16 +0000 (15:33 +0000)
commit3ce465f819a9d435ba05555fe29cf59a0eb641f3
tree7a0f174e55f5a4a9c13ce5aedd1ecd6a3a6c221d
parent407df0f164498d8beeb26fb50a470227b286cbb1
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.
ChangeLog
src/util.c
tests/Makefile.am
tests/read-non-seekable [new file with mode: 0755]
tests/test-lib.sh