ubik: Don't record result of select()
[openafs.git] / src / ubik / beacon.c
index 1ff45ec..a3a48d6 100644 (file)
@@ -101,7 +101,8 @@ ubeacon_Debug(struct ubik_debug *aparm)
 }
 
 static int
-amSyncSite(void) {
+amSyncSite(void)
+{
     afs_int32 now;
     afs_int32 rcode;
 
@@ -420,12 +421,11 @@ ubeacon_Interact(void *dummy)
            tt.tv_sec = temp;
            tt.tv_usec = 0;
 #ifdef AFS_PTHREAD_ENV
-           code = select(0, 0, 0, 0, &tt);
+           select(0, 0, 0, 0, &tt);
 #else
-           code = IOMGR_Select(0, 0, 0, 0, &tt);
+           IOMGR_Select(0, 0, 0, 0, &tt);
 #endif
-       } else
-           code = 0;
+       }
 
        lastWakeupTime = FT_ApproxTime();       /* started a new collection phase */
 
@@ -512,6 +512,12 @@ ubeacon_Interact(void *dummy)
                               (int)code, afs_inet_ntoa_r(ts->addr[0], hoststr));
                    code = -1;
                }
+               if (code > 0 && rx_ConnError(connections[multi_i])) {
+                   ubik_print("assuming vote from %s is invalid due to conn error %d; marking host down\n",
+                              afs_inet_ntoa_r(ts->addr[0], hoststr),
+                              (int)rx_ConnError(connections[multi_i]));
+                   code = -1;
+               }
 
                /* note that the vote time (the return code) represents the time
                 * the vote was computed, *not* the time the vote expires.  We compute
@@ -653,7 +659,7 @@ verifyInterfaceAddress(afs_uint32 *ame, struct afsconf_cell *info,
     }
 
     if (count <= 0) {          /* no address found */
-       ubik_print("ubik: No network addresses found, aborting..");
+       ubik_print("ubik: No network addresses found, aborting..\n");
        return UBADHOST;
     }
 
@@ -677,7 +683,7 @@ verifyInterfaceAddress(afs_uint32 *ame, struct afsconf_cell *info,
            *ame = myAddr[0];
            tcount = rx_getAllAddr(myAddr2, UBIK_MAX_INTERFACE_ADDR);
            if (tcount <= 0) {  /* no address found */
-               ubik_print("ubik: No network addresses found, aborting..");
+               ubik_print("ubik: No network addresses found, aborting..\n");
                return UBADHOST;
            }
 
@@ -810,12 +816,11 @@ ubeacon_updateUbikNetworkAddress(afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR])
                UBIK_ADDR_UNLOCK;
            } else if (multi_error == UBADHOST) {
                code = UBADHOST;        /* remote CellServDB inconsistency */
-               ubik_print("Inconsistent Cell Info on server: ");
+               ubik_print("Inconsistent Cell Info on server:\n");
                UBIK_ADDR_LOCK;
                for (j = 0; j < UBIK_MAX_INTERFACE_ADDR && ts->addr[j]; j++)
-                   ubik_print("%s ", afs_inet_ntoa_r(ts->addr[j], hoststr));
+                   ubik_print("... %s\n", afs_inet_ntoa_r(ts->addr[j], hoststr));
                UBIK_ADDR_UNLOCK;
-               ubik_print("\n");
            } else {
                UBIK_BEACON_LOCK;
                ts->up = 0;     /* mark the remote server as down */