[PATCH] set_sock_tos: clean up error message

Mike Frysinger vapier at gentoo.org
Wed Nov 9 18:41:03 AEDT 2022


ping ...
-mike

On 29 Sep 2022 15:03, Mike Frysinger wrote:
> From: Mike Frysinger <vapier at chromium.org>
> 
> These include a trailing colon as if error() is going to display
> another string after the message, but it doesn't.  No other call
> to error() does this either.  So drop that.
> 
> One of the error messages also uses a %.100s format spec when
> showing the strerror() output, but this doesn't actually do
> anything.  So drop that.
> ---
>  misc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/misc.c b/misc.c
> index f2135803737a..e51bd434de3a 100644
> --- a/misc.c
> +++ b/misc.c
> @@ -278,7 +278,7 @@ set_sock_tos(int fd, int tos)
>  		debug3_f("set socket %d IP_TOS 0x%02x", fd, tos);
>  		if (setsockopt(fd, IPPROTO_IP, IP_TOS,
>  		    &tos, sizeof(tos)) == -1) {
> -			error("setsockopt socket %d IP_TOS %d: %s:",
> +			error("setsockopt socket %d IP_TOS %d: %s",
>  			    fd, tos, strerror(errno));
>  		}
>  # endif /* IP_TOS */
> @@ -288,7 +288,7 @@ set_sock_tos(int fd, int tos)
>  		debug3_f("set socket %d IPV6_TCLASS 0x%02x", fd, tos);
>  		if (setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS,
>  		    &tos, sizeof(tos)) == -1) {
> -			error("setsockopt socket %d IPV6_TCLASS %d: %.100s:",
> +			error("setsockopt socket %d IPV6_TCLASS %d: %s",
>  			    fd, tos, strerror(errno));
>  		}
>  # endif /* IPV6_TCLASS */
> -- 
> 2.37.3
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20221109/10865cf1/attachment.asc>


More information about the openssh-unix-dev mailing list