mirror of
https://github.com/OpenVPN/openvpn.git
synced 2024-11-27 11:43:51 +08:00
don't print errno twice
when passing the M_ERRNO flag to msg(), the latter will already print the errno message (in a form of a string and number) for us, hence there is no need to explicitly print it a second time. Signed-off-by: Antonio Quartulli <antonio@openvpn.net> Acked-by: Arne Schwabe <arne@rfc2549.org> Message-Id: <20170713080527.13299-2-a@unstable.cc> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15057.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
This commit is contained in:
parent
56b396dcbc
commit
e441d86188
@ -159,7 +159,7 @@ platform_nice(int niceval)
|
||||
errno = 0;
|
||||
if (nice(niceval) < 0 && errno != 0)
|
||||
{
|
||||
msg(M_WARN | M_ERRNO, "WARNING: nice %d failed: %s", niceval, strerror(errno));
|
||||
msg(M_WARN | M_ERRNO, "WARNING: nice %d failed", niceval);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2563,8 +2563,7 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun
|
||||
|
||||
if (ioctl(tt->fd, TUNGIFINFO, &info) < 0)
|
||||
{
|
||||
msg(M_WARN | M_ERRNO, "Can't get interface info: %s",
|
||||
strerror(errno));
|
||||
msg(M_WARN | M_ERRNO, "Can't get interface info");
|
||||
}
|
||||
|
||||
#ifdef IFF_MULTICAST /* openbsd 4.x doesn't have this */
|
||||
@ -2573,8 +2572,7 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun
|
||||
|
||||
if (ioctl(tt->fd, TUNSIFINFO, &info) < 0)
|
||||
{
|
||||
msg(M_WARN | M_ERRNO, "Can't set interface info: %s",
|
||||
strerror(errno));
|
||||
msg(M_WARN | M_ERRNO, "Can't set interface info");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2663,7 +2661,7 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun
|
||||
i = 1;
|
||||
if (ioctl(tt->fd, TUNSIFHEAD, &i) < 0) /* multi-af mode on */
|
||||
{
|
||||
msg(M_WARN | M_ERRNO, "ioctl(TUNSIFHEAD): %s", strerror(errno));
|
||||
msg(M_WARN | M_ERRNO, "ioctl(TUNSIFHEAD)");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2796,12 +2794,12 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun
|
||||
|
||||
if (ioctl(tt->fd, TUNSIFMODE, &i) < 0)
|
||||
{
|
||||
msg(M_WARN | M_ERRNO, "ioctl(TUNSIFMODE): %s", strerror(errno));
|
||||
msg(M_WARN | M_ERRNO, "ioctl(TUNSIFMODE)");
|
||||
}
|
||||
i = 1;
|
||||
if (ioctl(tt->fd, TUNSIFHEAD, &i) < 0)
|
||||
{
|
||||
msg(M_WARN | M_ERRNO, "ioctl(TUNSIFHEAD): %s", strerror(errno));
|
||||
msg(M_WARN | M_ERRNO, "ioctl(TUNSIFHEAD)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user