[PATCHES] multi-channel: implement network interface info ioctl

Jeremy Allison jra at samba.org
Mon Jan 25 18:52:00 UTC 2016


On Mon, Jan 25, 2016 at 09:06:06AM +0100, Stefan Metzmacher wrote:
> Hi Michael,
> 
> the NDR_PRINT_DEBUG(fsctl_net_iface_info, first); needs to be on
> a higher debug level.
> 
> 
> +	ret = ioctl(fd, SIOCETHTOOL, &ifr);
> +	if (ret == -1) {
> +		do {
> +			ret = close(fd);
> +		} while (ret == -1 && errno == EINTR);
> +
> +		return;
> +	}
> +	*speed = (ethtool_cmd_speed(&cmd)) * 1000 * 1000;
> +}
> 
> We should already close the fd, not only if ioctl fails!
> 
> Do we have a sys_close() that already does
> 
> +		do {
> +			ret = close(fd);
> +		} while (ret == -1 && errno == EINTR);
> 
> This hight be an generic problem (or is not needed at at all)
> @Volker,Jemery: Do we need EINTR on close?

It's an explicit error return listed in the man pages, and
some network file systems can return it.

See here:

https://lwn.net/Articles/576478/

for an interesting discussion.



More information about the samba-technical mailing list