Re: [PATCH] virFileInData: Report an error if unable to reposition file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 07/11/2017 05:05 AM, Michal Privoznik wrote:
> The purpose of this function is to tell if the current position
> in given FD is in data section or a hole and how much bytes there
> is remaining until the end of the section. This is achieved by
> couple of lseeks(). The most important part is that we reposition
> the FD back, so that the position is unchanged from the caller
> POV. And until now the final lseek() back to the original
> position was done with no check for errors. And I was convinced
> that that's okay since nothing can go wrong. However, John

Good thing there's only one John ;-)   Perhaps better said, "review
feedback from a related series persuaded me..."

> persuaded me, that it's better to be safe than sorry. Therefore,
> lets check if the final lseek() succeeded and if it doesn't
> report an error.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/util/virfile.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 

Reviewed-by: John Ferlan <jferlan@xxxxxxxxxx>

John

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux