ping6 to ping by me without thinking clearly.
pointed out by deraadt@
OK jca@
-/* $OpenBSD: ping.c,v 1.102 2014/04/23 18:16:36 jca Exp $ */
+/* $OpenBSD: ping.c,v 1.103 2014/04/28 15:25:34 florian Exp $ */
/* $NetBSD: ping.c,v 1.20 1995/08/11 22:37:58 cgd Exp $ */
/*
socklen_t fromlen;
struct pollfd pfd;
ssize_t cc;
- int ret, timeout;
+ int timeout;
if (options & F_FLOOD) {
pinger();
pfd.fd = s;
pfd.events = POLLIN;
- ret = poll(&pfd, 1, timeout);
- if (ret < 0) {
- if (errno != EINTR) {
- warn("poll");
- sleep(1);
- }
- continue;
- } else if (ret == 0)
+ if (poll(&pfd, 1, timeout) <= 0)
continue;
fromlen = sizeof(from);
-/* $OpenBSD: ping6.c,v 1.89 2014/04/23 18:16:36 jca Exp $ */
+/* $OpenBSD: ping6.c,v 1.90 2014/04/28 15:25:34 florian Exp $ */
/* $KAME: ping6.c,v 1.163 2002/10/25 02:19:06 itojun Exp $ */
/*
struct iovec iov[2];
struct pollfd pfd;
ssize_t cc;
- int ret, timeout;
+ int timeout;
/* signal handling */
if (seenalrm) {
pfd.fd = s;
pfd.events = POLLIN;
- ret = poll(&pfd, 1, timeout);
- if (ret < 0) {
- if (errno != EINTR) {
- warn("poll");
- sleep(1);
- }
- continue;
- } else if (ret == 0)
+ if (poll(&pfd, 1, timeout) <= 0)
continue;
m.msg_name = &from;