Re: [PATCH] (vshCloseLogFile): Diagnose close/write failure.

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

 



On Wed, Nov 28, 2007 at 09:45:05AM +0100, Jim Meyering wrote:
> I noticed a minor problem in vshCloseLogFile.
> Although callers do check for log-file write failure,
> this function doesn't check for close failure (which
> can happen, and indicates a write failure).
> 
> I considered changing the function to return an int
> and propagating that success/failure "up" to callers,
> but that change is more invasive, and I'm not sure it's
> desirable.  If any of you prefer it, let me know and
> I'll rewrite accordingly:

  I prefer the simpler version, as there isn't really much we
can do at that point if the error occurs, propagating it won't
help solving the issue, especially since it's supposed to be
called at the runtime end (likely on shutdowns).

> Also slightly ugly: ctl->logfile may be null, so if/when it is
> (however unlikely), the diagnostic prints "?" as the file name
> rather than trying to dereference a NULL pointer.

  Fine by me, +1

  thanks !

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard@xxxxxxxxxx  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

--
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]