Use spaces for indentation, not tabs.
[gnulib.git] / tests / test-getaddrinfo.c
index 57c1a4d..7464ec2 100644 (file)
@@ -75,31 +75,31 @@ simple (char const *host, char const *service)
   if (res != 0)
     {
       /* EAI_AGAIN is returned if no network is available. Don't fail
-        the test merely because someone is down the country on their
-        in-law's farm. */
+         the test merely because someone is down the country on their
+         in-law's farm. */
       if (res == EAI_AGAIN)
-       {
-         skip++;
-         fprintf (stderr, "skipping getaddrinfo test: no network?\n");
-         return 77;
-       }
+        {
+          skip++;
+          fprintf (stderr, "skipping getaddrinfo test: no network?\n");
+          return 77;
+        }
       /* IRIX reports EAI_NONAME for "https".  Don't fail the test
-        merely because of this.  */
+         merely because of this.  */
       if (res == EAI_NONAME)
-       return 0;
+        return 0;
       /* Solaris reports EAI_SERVICE for "http" and "https".  Don't
-        fail the test merely because of this.  */
+         fail the test merely because of this.  */
       if (res == EAI_SERVICE)
-       return 0;
+        return 0;
 #ifdef EAI_NODATA
       /* AIX reports EAI_NODATA for "https".  Don't fail the test
-        merely because of this.  */
+         merely because of this.  */
       if (res == EAI_NODATA)
-       return 0;
+        return 0;
 #endif
       /* Provide details if errno was set.  */
       if (res == EAI_SYSTEM)
-       dbgprintf ("system error: %s\n", strerror (err));
+        dbgprintf ("system error: %s\n", strerror (err));
 
       return 1;
     }
@@ -112,27 +112,27 @@ simple (char const *host, char const *service)
       dbgprintf ("\tprotocol %x\n", ai->ai_protocol);
       dbgprintf ("\taddrlen %ld: ", (unsigned long) ai->ai_addrlen);
       dbgprintf ("\tFound %s\n",
-                inet_ntop (ai->ai_family,
-                           &((struct sockaddr_in *)
-                             ai->ai_addr)->sin_addr,
-                           buf, sizeof (buf) - 1));
+                 inet_ntop (ai->ai_family,
+                            &((struct sockaddr_in *)
+                              ai->ai_addr)->sin_addr,
+                            buf, sizeof (buf) - 1));
       if (ai->ai_canonname)
-       dbgprintf ("\tFound %s...\n", ai->ai_canonname);
+        dbgprintf ("\tFound %s...\n", ai->ai_canonname);
 
       {
-       char ipbuf[BUFSIZ];
-       char portbuf[BUFSIZ];
-
-       res = getnameinfo (ai->ai_addr, ai->ai_addrlen,
-                          ipbuf, sizeof (ipbuf) - 1,
-                          portbuf, sizeof (portbuf) - 1,
-                          NI_NUMERICHOST|NI_NUMERICSERV);
-       dbgprintf ("\t\tgetnameinfo %d: %s\n", res, gai_strerror (res));
-       if (res == 0)
-         {
-           dbgprintf ("\t\tip %s\n", ipbuf);
-           dbgprintf ("\t\tport %s\n", portbuf);
-         }
+        char ipbuf[BUFSIZ];
+        char portbuf[BUFSIZ];
+
+        res = getnameinfo (ai->ai_addr, ai->ai_addrlen,
+                           ipbuf, sizeof (ipbuf) - 1,
+                           portbuf, sizeof (portbuf) - 1,
+                           NI_NUMERICHOST|NI_NUMERICSERV);
+        dbgprintf ("\t\tgetnameinfo %d: %s\n", res, gai_strerror (res));
+        if (res == 0)
+          {
+            dbgprintf ("\t\tip %s\n", ipbuf);
+            dbgprintf ("\t\tport %s\n", portbuf);
+          }
       }
 
     }
@@ -166,8 +166,8 @@ int main (void)
 
     if (data.wVersion < requested)
       {
-       WSACleanup ();
-       return 2;
+        WSACleanup ();
+        return 2;
       }
   }
 #endif