Mailing List Archive

[PATCH] set_sock_tos: clean up error message
From: Mike Frysinger <vapier@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

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: [PATCH] set_sock_tos: clean up error message [ In reply to ]
ping ...
-mike

On 29 Sep 2022 15:03, Mike Frysinger wrote:
> From: Mike Frysinger <vapier@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
>
Re: [PATCH] set_sock_tos: clean up error message [ In reply to ]
On Wed, 9 Nov 2022 at 18:43, Mike Frysinger <vapier@gentoo.org> wrote:
>
> ping ...

applied upstream, thanks.

--
Darren Tucker (dtucker at dtucker.net)
GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860 37F4 9357 ECEF 11EA A6FA (new)
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev