Re: [PATCH 1/3] Coverity: Resolve a CHECKED_RETURN message

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

 



On 03/25/2014 12:00 PM, John Ferlan wrote:
> Recent changes to the module seemed to have caused Coverity to find a new
> issue regarding the failure to check the return from a sendmsg. The code
> doesn't seem to care about the return status, so just added an ignore_value
> to keep Coverity quiet.
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  src/util/virlog.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

ACK - logging is one of the few places where we don't care if the
sendmsg succeeded (what are we going to do if it failed - log a failure
message through the failed interface?  :)

> 
> diff --git a/src/util/virlog.c b/src/util/virlog.c
> index d0afd10..056950e 100644
> --- a/src/util/virlog.c
> +++ b/src/util/virlog.c
> @@ -1003,7 +1003,7 @@ virLogOutputToJournald(virLogSourcePtr source,
>  
>      mh.msg_controllen = cmsg->cmsg_len;
>  
> -    sendmsg(journalfd, &mh, MSG_NOSIGNAL);
> +    ignore_value(sendmsg(journalfd, &mh, MSG_NOSIGNAL));
>  
>   cleanup:
>      VIR_LOG_CLOSE(buffd);
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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