]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: tweak condition to properly test lseek
authorErik Skultety <eskultet@redhat.com>
Tue, 3 Mar 2015 15:57:38 +0000 (16:57 +0100)
committerCole Robinson <crobinso@redhat.com>
Tue, 28 Apr 2015 15:06:38 +0000 (11:06 -0400)
commit6ae19e709eb5c4b73e618a7efdd94bd2de5b4686
tree09db0065b8be0f2e21e9bb4e89bfbef080ce0951
parent41fdb1139114041f1882f5eecaab1d235c221a40
storage: tweak condition to properly test lseek

According to the POSIX standard, off_t (returned by lseek) is defined as
signed integral type no shorter than int. Because our offset variable is defined
as unsigned long long, the original check was passed successfully if UINT64_MAX had
been used as offset value, due to implicit conversion.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1177219
(cherry picked from commit 3fde7986d6694f122ae919d68ec64eee79bd51db)
src/fdstream.c