]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Beautify ubik_print()
authorThorsten Alteholz <openafs@alteholz.de>
Sun, 3 Feb 2013 10:58:25 +0000 (11:58 +0100)
committerStephan Wiesand <stephan.wiesand@desy.de>
Sat, 30 Mar 2013 20:03:01 +0000 (13:03 -0700)
After lots of intermediate steps a call to ubik_print(), ubik_vprint()
and ubik_dprint*() ends in vFSLog() which adds a timestamp to the output.
So any call to ubik_print(), that does not contain a \n at the end,
makes a mess of the logfile.
The least invasive change will simply add this newline at the end
of any ubik_print() call.
This also prevents long lines in the log, which might appear on
multi-homed hosts with lots of interfaces.

FIXES 1446

Reviewed-on: http://gerrit.openafs.org/9059
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit dc32caae7768c486e610c4e56c6a78e9c918d975)

Change-Id: I05892d6d9c47517208e21a3ab00bad2f30d58ba9
Reviewed-on: http://gerrit.openafs.org/9522
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/ubik/beacon.c
src/ubik/remote.c
src/ubik/ubik.c

index 1d3ee6dfb91179e1afa975deb688958149b81dde..0e64b2bc4a54e24cb5b0ddf90f78d812dc661298 100644 (file)
@@ -556,7 +556,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;
     }
 
@@ -580,7 +580,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;
            }
 
@@ -707,10 +707,9 @@ updateUbikNetworkAddress(afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR])
                     afs_inet_ntoa_r(ts->addr[0], hoststr));
            } 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");
                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("\n");
+                   ubik_print("... %s\n", afs_inet_ntoa_r(ts->addr[j], hoststr));
            } else {
                ts->up = 0;     /* mark the remote server as down */
            }
index a669da2ea16ac69b9c2dc951e29ca1c49353ee57..010dfbd23aeb5f9ad84383199e66f7b68ef6c812 100644 (file)
@@ -697,10 +697,9 @@ SDISK_UpdateInterfaceAddr(struct rx_call *rxcall,
     /* if (probableMatch) */
     /* inconsistent addresses in CellServDB */
     if (!probableMatch || found) {
-       ubik_print("Inconsistent Cell Info from server: ");
+       ubik_print("Inconsistent Cell Info from server:\n");
        for (i = 0; i < UBIK_MAX_INTERFACE_ADDR && inAddr->hostAddr[i]; i++)
-           ubik_print("%s ", afs_inet_ntoa_r(htonl(inAddr->hostAddr[i]), hoststr));
-       ubik_print("\n");
+           ubik_print("... %s\n", afs_inet_ntoa_r(htonl(inAddr->hostAddr[i]), hoststr));
        fflush(stdout);
        fflush(stderr);
        printServerInfo();
@@ -711,10 +710,9 @@ SDISK_UpdateInterfaceAddr(struct rx_call *rxcall,
     for (i = 1; i < UBIK_MAX_INTERFACE_ADDR; i++)
        ts->addr[i] = htonl(inAddr->hostAddr[i]);
 
-    ubik_print("ubik: A Remote Server has addresses: ");
+    ubik_print("ubik: A Remote Server has addresses:\n");
     for (i = 0; i < UBIK_MAX_INTERFACE_ADDR && ts->addr[i]; i++)
-       ubik_print("%s ", afs_inet_ntoa_r(ts->addr[i], hoststr));
-    ubik_print("\n");
+       ubik_print("... %s\n", afs_inet_ntoa_r(ts->addr[i], hoststr));
 
     return 0;
 }
@@ -726,13 +724,12 @@ printServerInfo(void)
     int i, j = 1;
     char hoststr[16];
 
-    ubik_print("Local CellServDB:");
+    ubik_print("Local CellServDB:\n");
     for (ts = ubik_servers; ts; ts = ts->next, j++) {
-       ubik_print("Server %d: ", j);
+       ubik_print("  Server %d:\n", j);
        for (i = 0; (i < UBIK_MAX_INTERFACE_ADDR) && ts->addr[i]; i++)
-           ubik_print("%s ", afs_inet_ntoa_r(ts->addr[i], hoststr));
+           ubik_print("  ... %s\n", afs_inet_ntoa_r(ts->addr[i], hoststr));
     }
-    ubik_print("\n");
 }
 
 afs_int32
index cb04bf526a047640658be7ef41934652d1b48b0b..ce1c847a05b678e7c733b7f19e2479fa2c36c729 100644 (file)
@@ -1409,7 +1409,7 @@ panic(char *format, ...)
     va_list ap;
 
     va_start(ap, format);
-    ubik_print("Ubik PANIC: ");
+    ubik_print("Ubik PANIC:\n");
     ubik_vprint(format, ap);
     va_end(ap);