From: Roy Marples Date: Mon, 21 Jan 2008 16:08:42 +0000 (+0000) Subject: Prefer for (;;) over while (1) X-Git-Tag: v3.2.3~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4db036104af1015a4ffd7b3d3bcd55fc47d6292;p=thirdparty%2Fdhcpcd.git Prefer for (;;) over while (1) --- diff --git a/arp.c b/arp.c index 538bdfdb..acc24118 100644 --- a/arp.c +++ b/arp.c @@ -141,7 +141,7 @@ int arp_claim (interface_t *iface, struct in_addr address) buffer = xmalloc (iface->buffer_length); reply = xmalloc (iface->buffer_length); - while (1) { + for (;;) { struct timeval tv; int bufpos = -1; int buflen = iface->buffer_length; diff --git a/client.c b/client.c index 2cac55b4..9f704d5f 100644 --- a/client.c +++ b/client.c @@ -999,7 +999,7 @@ int dhcp_run (const options_t *options, int *pidfd) signal_setup (); - while (1) { + for (;;) { retval = wait_for_packet (&rset, state, options); /* We should always handle our signals first */ diff --git a/interface.c b/interface.c index 060c1416..00474242 100644 --- a/interface.c +++ b/interface.c @@ -171,7 +171,7 @@ static int _do_interface (const char *ifname, /* Not all implementations return the needed buffer size for * SIOGIFCONF so we loop like so for all until it works */ memset (&ifc, 0, sizeof (struct ifconf)); - while (1) { + for (;;) { ifc.ifc_len = len; ifc.ifc_buf = xmalloc (len); if (ioctl (s, SIOCGIFCONF, &ifc) == -1) { @@ -715,7 +715,7 @@ static int send_netlink(struct nlmsghdr *hdr) memset (buffer, 0, BUFFERLEN); iov.iov_base = buffer; - while (1) { + for (;;) { iov.iov_len = BUFFERLEN; bytes = recvmsg (s, &msg, 0); diff --git a/ipv4ll.c b/ipv4ll.c index e6ecf87c..31948b3c 100644 --- a/ipv4ll.c +++ b/ipv4ll.c @@ -43,7 +43,7 @@ int ipv4ll_get_address (interface_t *iface, dhcp_t *dhcp) { struct in_addr addr; - while (1) { + for (;;) { addr.s_addr = htonl (LINKLOCAL_ADDR | ((abs (random ()) % 0xFD00) + 0x0100)); errno = 0;