]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Prefer for (;;) over while (1)
authorRoy Marples <roy@marples.name>
Mon, 21 Jan 2008 16:08:42 +0000 (16:08 +0000)
committerRoy Marples <roy@marples.name>
Mon, 21 Jan 2008 16:08:42 +0000 (16:08 +0000)
arp.c
client.c
interface.c
ipv4ll.c

diff --git a/arp.c b/arp.c
index 538bdfdb57abb675ba41b2bd47c789f2f8f1281b..acc24118a730fe36263c865e76f7dd1b1d15c307 100644 (file)
--- 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;
index 2cac55b43e011250f7ee96ac578ed3ee2e67d8e6..9f704d5f57e31272bbaa51a94c71ac22c835b757 100644 (file)
--- 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 */
index 060c1416f8701ffaf6f68dfda72434f16737a9cc..004742420c8fdbfa53f3c51033ed09032e488745 100644 (file)
@@ -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);
 
index e6ecf87cfe8bfb84177b873354fb5e2b1a9b8d97..31948b3cd9f09fcbea9169b6748332d53a4e0470 100644 (file)
--- 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;