From 10157d82c3e8f7cbdec768d92119ed5be126b844 Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Thu, 14 Jun 2018 15:01:18 -0400 Subject: [PATCH] ubik: do not assign variables in logging argument lists Several logging statements in ubik contain an assignment statement within the logging function call argument list, which would set a variable as side effect of evaluating the function call arguments. These embedded assignments are problematic since the logging function calls have been replaced by ViceLog macros, which avoid the overhead of a function call depending on logging levels. Remove the embedded assignments within the logging argument lists so the variables are always set regardless of the logging level. Reviewed-on: https://gerrit.openafs.org/13211 Tested-by: BuildBot Reviewed-by: Joe Gorse Reviewed-by: Andrew Deason Reviewed-by: Marcio Brito Barbosa Reviewed-by: Benjamin Kaduk (cherry picked from commit 472d6b1ee2f7de415e0fa0f8be0636f86956b6fc) Change-Id: I230f71022a58445c99adc67ae1b888caa4ce260e Reviewed-on: https://gerrit.openafs.org/13218 Reviewed-by: Andrew Deason Reviewed-by: Mark Vitale Reviewed-by: Michael Meffie Reviewed-by: Marcio Brito Barbosa Reviewed-by: Cheyenne Wills Tested-by: BuildBot Reviewed-by: Stephan Wiesand --- src/ubik/recovery.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ubik/recovery.c b/src/ubik/recovery.c index fd726a558..7ea8e4780 100644 --- a/src/ubik/recovery.c +++ b/src/ubik/recovery.c @@ -611,7 +611,7 @@ urecovery_Interact(void *dummy) nbytes = rx_Read(rxcall, (char *)&length, sizeof(afs_int32)); length = ntohl(length); if (nbytes != sizeof(afs_int32)) { - ViceLog(5, ("Rx-read length error=%d\n", code = BULK_ERROR)); + ViceLog(5, ("Rx-read length error=%d\n", BULK_ERROR)); code = EIO; goto FetchEndCall; } @@ -648,7 +648,7 @@ urecovery_Interact(void *dummy) #endif nbytes = rx_Read(rxcall, tbuffer, tlen); if (nbytes != tlen) { - ViceLog(5, ("Rx-read bulk error=%d\n", code = BULK_ERROR)); + ViceLog(5, ("Rx-read bulk error=%d\n", BULK_ERROR)); code = EIO; close(fd); goto FetchEndCall; @@ -833,14 +833,14 @@ urecovery_Interact(void *dummy) (*ubik_dbase->read) (ubik_dbase, file, tbuffer, offset, tlen); if (nbytes != tlen) { - ViceLog(5, ("Local disk read error=%d\n", - code = UIOERROR)); + code = UIOERROR; + ViceLog(5, ("Local disk read error=%d\n", code)); goto StoreEndCall; } nbytes = rx_Write(rxcall, tbuffer, tlen); if (nbytes != tlen) { - ViceLog(5, ("Rx-write bulk error=%d\n", code = - BULK_ERROR)); + code = BULK_ERROR; + ViceLog(5, ("Rx-write bulk error=%d\n", code)); goto StoreEndCall; } offset += tlen; -- 2.39.5