fixes from Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
This commit is contained in:
parent
d514ba226b
commit
806116b234
@ -415,7 +415,7 @@ static void print_ascii(const char *str)
|
|||||||
n = strcspn(str, controls);
|
n = strcspn(str, controls);
|
||||||
if (n) {
|
if (n) {
|
||||||
if (!str[n]) break;
|
if (!str[n]) break;
|
||||||
printf("%.*s", n, str);
|
printf("%.*s", (int) n, str);
|
||||||
str += n;
|
str += n;
|
||||||
}
|
}
|
||||||
n = strspn(str, controls);
|
n = strspn(str, controls);
|
||||||
|
@ -117,8 +117,9 @@ static void ping(const char *host)
|
|||||||
struct sockaddr_in from;
|
struct sockaddr_in from;
|
||||||
socklen_t fromlen = sizeof(from);
|
socklen_t fromlen = sizeof(from);
|
||||||
|
|
||||||
if ((c = recvfrom(pingsock, packet, sizeof(packet), 0,
|
c = recvfrom(pingsock, packet, sizeof(packet), 0,
|
||||||
(struct sockaddr *) &from, &fromlen)) < 0) {
|
(struct sockaddr *) &from, &fromlen);
|
||||||
|
if (c < 0) {
|
||||||
if (errno == EINTR)
|
if (errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
bb_perror_msg("recvfrom");
|
bb_perror_msg("recvfrom");
|
||||||
|
@ -104,10 +104,11 @@ static void ping(const char *host)
|
|||||||
/* listen for replies */
|
/* listen for replies */
|
||||||
while (1) {
|
while (1) {
|
||||||
struct sockaddr_in6 from;
|
struct sockaddr_in6 from;
|
||||||
size_t fromlen = sizeof(from);
|
socklen_t fromlen = sizeof(from);
|
||||||
|
|
||||||
if ((c = recvfrom(pingsock, packet, sizeof(packet), 0,
|
c = recvfrom(pingsock, packet, sizeof(packet), 0,
|
||||||
(struct sockaddr *) &from, &fromlen)) < 0) {
|
(struct sockaddr *) &from, &fromlen);
|
||||||
|
if (c < 0) {
|
||||||
if (errno == EINTR)
|
if (errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
bb_perror_msg("recvfrom");
|
bb_perror_msg("recvfrom");
|
||||||
|
Loading…
Reference in New Issue
Block a user