Skip to content

Commit

Permalink
ping: Use error() consistently
Browse files Browse the repository at this point in the history
strerror() is called in error(), no need to call it outside.
Not a bug, just trying to be consistent (better cleanup could be a
suggestion in iputils#552).

Fixes: eef1c38 ("ping: make command to use glibc error printing facility")
Reviewed-by: Cyril Hrubis <[email protected]>
Signed-off-by: Petr Vorel <[email protected]>
  • Loading branch information
pevik committed Sep 2, 2024
1 parent a148399 commit 202dee1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ping/ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,7 @@ int ping4_receive_error_msg(struct ping_rts *rts, socket_st *sock)
if (rts->opt_flood)
write_stdout("E", 1);
else if (e->ee_errno != EMSGSIZE)
error(0, 0, _("local error: %s"), strerror(e->ee_errno));
error(0, e->ee_errno, _("local error"));
else
error(0, 0, _("local error: message too long, mtu=%u"), e->ee_info);
rts->nerrors++;
Expand Down

0 comments on commit 202dee1

Please sign in to comment.