While calling perror() on send() failure was useful for debugging the

if_em "wedging" problem, large numbers of perror() calls impacts send
performance.  As such, just count the error, don't print it.
This commit is contained in:
rwatson 2004-09-30 06:17:26 +00:00
parent af519fd928
commit 724b02db8c
2 changed files with 2 additions and 3 deletions

View File

@ -2,6 +2,7 @@
# $FreeBSD$
#
CFLAGS+= -Wall
PROG= netsend
NOMAN= yes

View File

@ -170,10 +170,8 @@ timing_loop(int s, struct timespec interval, long duration, u_char *packet,
*((u_int32_t *)packet) = htonl(counter);
counter++;
}
if (send(s, packet, packet_len, 0) < 0) {
perror("send");
if (send(s, packet, packet_len, 0) < 0)
send_errors++;
}
send_calls++;
if (duration != 0 && tmptime.tv_sec >= finishtime)
goto done;