Re: [PATCH 1/4] tools: hv: Check return value of setsockopt call

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

 



On Tue, May 21, 2013 at 03:36:52PM +0200, Tomas Hozza wrote:
> Check return value of setsockopt call and if it fails print error
> to the system log and exit with non-zero value.
> 
> Signed-off-by: Tomas Hozza <thozza@xxxxxxxxxx>
> ---
>  tools/hv/hv_kvp_daemon.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
> index 5a1f648..b30f831 100644
> --- a/tools/hv/hv_kvp_daemon.c
> +++ b/tools/hv/hv_kvp_daemon.c
> @@ -1457,7 +1457,13 @@ int main(void)
>  		exit(EXIT_FAILURE);
>  	}
>  	nl_group = CN_KVP_IDX;
> -	setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &nl_group, sizeof(nl_group));
> +	
> +	if (setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &nl_group, sizeof(nl_group)) < 0) {
> +		syslog(LOG_ERR, "setsockopt failed; error: %d %s" errno, strerror(errno));

Please resend this whole series, in a format that actually builds :(

Also, when resending, please put a "v2" or really, "v3", and include a
list of what you changed (i.e. "actually built and tested my changes").

ugh.

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux