Remove unreached lines
authorAndrew Deason <adeason@sinenomine.net>
Mon, 22 Nov 2010 02:29:11 +0000 (21:29 -0500)
committerDerrick Brashear <shadow@dementia.org>
Tue, 7 Dec 2010 05:38:13 +0000 (21:38 -0800)
Fix some macros to eliminate unreached trailing empty statements (such
as: "{code = foo; goto error;};"), and other oddities causing
"statement not reached" warnings. Also eliminate a couple of code
blocks that were never reached.

Change-Id: Iac626976268e13f5ef05f379ad1c9b5437c57f86
Reviewed-on: http://gerrit.openafs.org/3368
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

27 files changed:
src/afs/afs_disconnected.c
src/afs/afs_pioctl.c
src/bozo/bnode.c
src/bu_utils/fms.c
src/bucoord/commands.c
src/bucoord/error_macros.h
src/budb/error_macros.h
src/butc/dump.c
src/butc/error_macros.h
src/butc/recoverDb.c
src/butm/error_macros.h
src/butm/file_tm.c
src/kauth/krb_tf.c
src/rxgen/rpc_parse.c
src/ubik/ubik.c
src/venus/up.c
src/vlserver/vlprocs.c
src/vlserver/vlutils.c
src/vol/clone.c
src/vol/daemon_com_inline.h
src/vol/fssync-debug.c
src/vol/fssync_inline.h
src/vol/namei_ops.c
src/vol/volume.c
src/vol/volume_inline.h
src/volser/vos.c
src/volser/vsprocs.c

index 7f76064..9de6e8c 100644 (file)
@@ -185,7 +185,6 @@ afs_GetParentDirFid(struct vcache *avc, struct VenusFid *afid)
        break;
     default:
        return -1;
-       break;
     }
 
     return 0;
index 5bd07d8..f3f13fd 100644 (file)
@@ -4362,7 +4362,6 @@ DECL_PIOCTL(PGetInitParams)
 
     return afs_pd_putBytes(aout, &cm_initParams,
                           sizeof(struct cm_initparams));
-    return 0;
 }
 
 #ifdef AFS_SGI65_ENV
index 6dcd823..374c7b2 100644 (file)
@@ -948,7 +948,6 @@ bnode_ParseLine(char *aline, struct bnode_token **alist)
            return 0;
        }
     }
-    return 0;
 }
 
 #define        MAXVARGS            128
index 03ed626..6d4878b 100644 (file)
@@ -39,11 +39,10 @@ static int tt_fileMarkSize(struct cmd_syndesc *as, void *arock);
 afs_int32 rewindTape(usd_handle_t hTape);
 int dataBlock(usd_handle_t, afs_int32);
 
-#define ERROR(evalue)                                           \
-        {                                                       \
+#define ERROR(evalue) do {                                      \
             code = evalue;                                      \
             goto error_exit;                                    \
-        }
+        } while (0)
 
 #define MAXV   100
 
index 8c61871..324510d 100644 (file)
@@ -1128,7 +1128,6 @@ bc_KillCmd(struct cmd_syndesc *as, void *arock)
        }
        statusPtr->flags |= ABORT_REQUEST;
        unlock_Status();
-       return (0);
     }
     return 0;
 }
index c1d0a5f..aac6bd6 100644 (file)
@@ -8,15 +8,13 @@
  */
 
 #undef ERROR
-#define ERROR(evalue)                                           \
-       {                                                       \
+#define ERROR(evalue) do {                                      \
             code = evalue;                                      \
             goto error_exit;                                    \
-        }
+        } while (0)
 
 #undef ABORT
-#define ABORT(evalue)                                           \
-       {                                                       \
+#define ABORT(evalue) do {                                      \
             code = evalue;                                      \
             goto abort_exit;                                    \
-        }
+        } while (0)
index 99531be..71c35c3 100644 (file)
@@ -7,20 +7,17 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
-#define ERROR(evalue)                                           \
-       {                                                       \
+#define ERROR(evalue) do {                                      \
             code = evalue;                                      \
             goto error_exit;                                    \
-        }
+        } while (0)
 
-#define ABORT(evalue)                                           \
-       {                                                       \
+#define ABORT(evalue) do {                                      \
             code = evalue;                                      \
             goto abort_exit;                                    \
-        }
+        } while (0)
 
-#define BUDB_EXIT(evalue)                                       \
-       {                                                       \
+#define BUDB_EXIT(evalue) do {                                  \
             osi_audit(BUDB_ExitEvent, evalue, AUD_END);         \
            exit(evalue);                                       \
-        }
+        } while (0)
index 2a41c39..e1da036 100644 (file)
@@ -160,11 +160,9 @@ calcExpirationDate(afs_int32 expType, afs_int32 expDate, afs_int32 createTime)
         */
        Int32To_ktimeRelDate(expDate, &kd);
        return (Add_RelDate_to_Time(&kd, createTime));
-       break;
 
     case BC_ABS_EXPDATE:
        return (expDate);
-       break;
 
     case BC_NO_EXPDATE:
     default:
@@ -932,7 +930,6 @@ dumpPass(struct dumpRock * dparamsPtr, int passNumber)
                         curDump->name, curDump->vid);
                curDump->hostAddr = 0;
                continue;
-               break;
            }
 
            if (e >= vldbEntry.nServers) {
@@ -1024,7 +1021,6 @@ dumpPass(struct dumpRock * dparamsPtr, int passNumber)
                case 'r':       /* retry */
                    dparamsPtr->curVolume--;    /* redump this volume */
                    continue;
-                   break;
                case 'o':       /* omit */
                    ErrorLog(1, taskId, 0, 0, "Volume %s (%u) omitted\n",
                             curDump->name, curDump->vid);
@@ -1056,7 +1052,6 @@ dumpPass(struct dumpRock * dparamsPtr, int passNumber)
 
            dparamsPtr->curVolume--;    /* redump this volume */
            continue;
-           break;
 
        case DUMP_NORETRYEOT:
            ErrorLog(1, taskId, 0, 0,
index 7042426..d9c199c 100644 (file)
@@ -7,23 +7,20 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
-#define ERROR_EXIT(evalue)                                      \
-       {                                                       \
+#define ERROR_EXIT(evalue) do {                                 \
             code = evalue;                                      \
             goto error_exit;                                    \
-        }
+        } while (0)
 
-#define ERROR_EXIT2(evalue)                                     \
-       {                                                       \
+#define ERROR_EXIT2(evalue) do {                                \
             code = evalue;                                      \
             goto error_exit2;                                   \
-        }
+        } while (0)
 
-#define ABORT_EXIT(evalue)                                      \
-       {                                                       \
+#define ABORT_EXIT(evalue) do {                                 \
             code = evalue;                                      \
             goto abort_exit;                                    \
-        }
+        } while (0)
 
 extern void ErrorLog(int debug, afs_int32 task, afs_int32 error1,
                     afs_int32 error2, char *fmt, ...)
index f7699f4..b5aa3b5 100644 (file)
@@ -191,7 +191,7 @@ scanVolData(afs_int32 taskId, struct butm_tapeInfo *curTapePtr,
 
     tcode = NextFile(curTapePtr);      /* guarantees we are at a filemark */
     if (tcode)
-       ERROR_EXIT(tcode)
+       ERROR_EXIT(tcode);
 
            /* Read the FileBegin FileMark */
            code = butm_ReadFileBegin(curTapePtr);
@@ -248,7 +248,7 @@ scanVolData(afs_int32 taskId, struct butm_tapeInfo *curTapePtr,
 
            ErrorLog(0, taskId, rcode, curTapePtr->error,
                     "Can't read FileData on tape\n");
-           ERROR_EXIT(rcode)
+           ERROR_EXIT(rcode);
        }
        hasdata[curr] = 1;
        *bytesRead += nbytes;
index 7a387cf..f5e2f63 100644 (file)
@@ -7,14 +7,12 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
-#define ERROR_EXIT(evalue)                                      \
-       {                                                       \
+#define ERROR_EXIT(evalue) do {                                 \
             code = evalue;                                      \
             goto error_exit;                                    \
-        }
+        } while (0)
 
-#define ABORT_EXIT(evalue)                                      \
-       {                                                       \
+#define ABORT_EXIT(evalue) do {                                 \
             code = evalue;                                      \
             goto abort_exit;                                    \
-        }
+        } while (0)
index 44c47ab..d5390e8 100644 (file)
@@ -588,7 +588,7 @@ Rewind(usd_handle_t fid)
        return (USD_SEEK(fid, startOff, SEEK_SET, &stopOff));
     } else {
        return (ForkIoctl(fid, USDTAPE_REW, 0));
-    };
+    }
 }
 
 /* prepare tape drive for access */
index 536a16b..ed48dd5 100644 (file)
 #include "kautils.h"
 #include "kauth_internal.h"
 
-#ifndef WORDS_BIGENDIAN
-/* This was taken from jhutz's patch for heimdal krb4. It only
- * applies to little endian systems. Big endian systems have a
- * less elegant solution documented below.
- *
- * This record is written after every real ticket, to ensure that
- * both 32- and 64-bit readers will perceive the next real ticket
- * as starting in the same place.  This record looks like a ticket
- * with the following properties:
- *   Field         32-bit             64-bit
- *   ============  =================  =================
- *   sname         "."                "."
- *   sinst         ""                 ""
- *   srealm        ".."               ".."
- *   session key   002E2E00 xxxxxxxx  xxxxxxxx 00000000
- *   lifetime      0                  0
- *   kvno          0                  12
- *   ticket        12 nulls           4 nulls
- *   issue         0                  0
- */
-static unsigned char align_rec[] = {
-    0x2e, 0x00, 0x00, 0x2e, 0x2e, 0x00, 0x00, 0x2e,
-    0x2e, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00,
-    0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00
-};
-
-#else /* AFSLITTLE_ENDIAN */
-
-/* This was taken from asedeno's patch for MIT Kerberos. These
- * alignment records are for big endian systems. We need more of them
- * because the portion of the 64-bit issue_date that overlaps with the
- * start of a ticket on 32-bit systems contains an unpredictable
- * number of NULL bytes. Preceeding these records is a second copy of
- * the 32-bit issue_date. The srealm for the alignment records is
- * always one of ".." or "?.."
- */
-
-/* No NULL bytes
- * This is actually two alignment records since both 32- and 64-bit
- * readers will agree on everything in the first record up through the
- * issue_date size, except where sname starts.
- *   Field (1)     32-bit             64-bit
- *   ============  =================  =================
- *   sname         "????."            "."
- *   sinst         ""                 ""
- *   srealm        ".."               ".."
- *   session key   00000000 xxxxxxxx  00000000 xxxxxxxx
- *   lifetime      0                  0
- *   kvno          0                  0
- *   ticket        4 nulls           4 nulls
- *   issue         0                  0
- *
- *   Field (2)     32-bit             64-bit
- *   ============  =================  =================
- *   sname         "."                "."
- *   sinst         ""                 ""
- *   srealm        ".."               ".."
- *   session key   002E2E00 xxxxxxxx  xxxxxxxx 00000000
- *   lifetime      0                  0
- *   kvno          0                  12
- *   ticket        12 nulls           4 nulls
- *   issue         0                  0
- *
- */
-static unsigned char align_rec_0[] = {
-    0x2e, 0x00, 0x00, 0x2e, 0x2e, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x2e, 0x00, 0x00, 0x2e, 0x2e, 0x00,
-    0x00, 0x2e, 0x2e, 0x00, 0xff, 0xff, 0xff, 0xff,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00
-};
-
-/* One NULL byte
- *   Field         32-bit             64-bit
- *   ============  =================  =================
- *   sname         "x"  |"xx"|"xxx"   "."
- *   sinst         "xx."|"x."|"."     ".."
- *   srealm        ".."               "..."
- *   session key   2E2E2E00 xxxxxxxx  xxxxxxxx 00000000
- *   lifetime      0                  0
- *   kvno          0                  12
- *   ticket        12 nulls           4 nulls
- *   issue         0                  0
- */
-static unsigned char align_rec_1[] = {
-    0x2e, 0x00, 0x2e, 0x2e, 0x00, 0x2e, 0x2e, 0x2e,
-    0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00
-};
-
-/* Two NULL bytes
- *   Field         32-bit             64-bit
- *   ============  =================  =================
- *   sname         "x"  |"x" |"xx"    ".."
- *   sinst         ""   |"x" |""      ""
- *   srealm        "x.."|".."|".."    ".."
- *   session key   002E2E00 xxxxxxxx  xxxxxxxx 00000000
- *   lifetime      0                  0
- *   kvno          0                  12
- *   ticket        12 nulls           4 nulls
- *   issue         0                  0
- */
- static unsigned char align_rec_2[] = {
-    0x2e, 0x2e, 0x00, 0x00, 0x2e, 0x2e, 0x00, 0xff,
-    0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00,
-    0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-/* Three NULL bytes
- * Things break here for 32-bit krb4 libraries that don't
- * understand this alignment record. We can't really do
- * anything about the fact that the three strings ended
- * in the duplicate timestamp. The good news is that this
- * only happens once every 0x1000000 seconds, once roughly
- * every six and a half months. We'll live.
- *
- * Discussion on the krbdev list has suggested the
- * issue_date be incremented by one in this case to avoid
- * the problem. I'm leaving this here just in case.
- *
- *   Field         32-bit             64-bit
- *   ============  =================  =================
- *   sname         ""                 "."
- *   sinst         ""                 ""
- *   srealm        ""                 ".."
- *   session key   2E00002E 2E00FFFF  xxxx0000 0000xxxx
- *   lifetime      0                  0
- *   kvno          4294901760         917504
- *   ticket        14 nulls           4 nulls
- *   issue         0                  0
- */
-/*
-static unsigned char align_rec_3[] = {
-    0x2e, 0x00, 0x00, 0x2e, 0x2e, 0x00, 0xff, 0xff,
-    0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-*/
-#endif /* AFSLITTLE_ENDIAN */
-
 afs_int32
 krb_write_ticket_file(char *realm)
 {
@@ -303,67 +148,6 @@ krb_write_ticket_file(char *realm)
     close(fd);
     return 0;
 
-    /* Alignment Record, from MIT Kerberos */
-#ifndef WORDS_BIGENDIAN
-    if (write(fd, align_rec, sizeof(align_rec)) != sizeof(align_rec))
-       goto bad;
-#else /* AFSLITTLE_ENDIAN */
-    {
-       int null_bytes = 0;
-       if (0 == (token.startTime & 0xff000000))
-           ++null_bytes;
-       if (0 == (token.startTime & 0x00ff0000))
-           ++null_bytes;
-       if (0 == (token.startTime & 0x0000ff00))
-           ++null_bytes;
-       if (0 == (token.startTime & 0x000000ff))
-           ++null_bytes;
-
-       switch(null_bytes) {
-       case 0:
-            /* Issue date */
-           if (write(fd, (char *) token.startTime, sizeof(afs_int32))
-               != sizeof(afs_int32))
-               goto bad;
-           if (write(fd, align_rec_0, sizeof(align_rec_0))
-               != sizeof(align_rec_0))
-               goto bad;
-           break;
-
-       case 1:
-           /* Issue date */
-           if (write(fd, (char *) &token.startTime, sizeof(afs_int32))
-               != sizeof(afs_int32))
-               goto bad;
-           if (write(fd, align_rec_1, sizeof(align_rec_1))
-               != sizeof(align_rec_1))
-               goto bad;
-           break;
-
-       case 3:
-           /* Three NULLS are troublesome but rare. We'll just pretend
-            * they don't exist by decrementing the token.startTime.
-            */
-           --token.startTime;
-       case 2:
-           /* Issue date */
-           if (write(fd, (char *) &token.startTime, sizeof(afs_int32))
-               != sizeof(afs_int32))
-               goto bad;
-           if (write(fd, align_rec_2, sizeof(align_rec_2))
-               != sizeof(align_rec_2))
-               goto bad;
-           break;
-
-       default:
-            goto bad;
-       }
-    }
-#endif  /* AFSLITTLE_ENDIAN */
-    close(fd);
-    return 0;
-
-
   bad:
     close(fd);
     return -1;
index a650bdb..eb46021 100644 (file)
@@ -182,7 +182,6 @@ get_definition(void)
        break;
     case TOK_EOF:
        return (NULL);
-       break;
     case TOK_PACKAGE:
        def_package(defp);
        break;
index bd25f48..16584b6 100644 (file)
 
 #include <lwp.h>   /* temporary hack by klm */
 
-#define ERROR_EXIT(code) {error=(code); goto error_exit;}
+#define ERROR_EXIT(code) do { \
+    error = (code); \
+    goto error_exit; \
+} while (0)
 
 /*!
  * \file
index f8ceb6a..b911053 100644 (file)
@@ -777,5 +777,4 @@ isMountPoint(char *name, struct ViceIoctl *blob)
             */
        }
     }
-    return 4;
 }
index cb61fef..06c9fbf 100644 (file)
@@ -43,9 +43,15 @@ extern int extent_mod;
 extern struct afsconf_dir *vldb_confdir;
 extern struct ubik_dbase *VL_dbase;
 int maxnservers;
-#define ABORT(c) { errorcode = (c); goto abort; }
+#define ABORT(c) do { \
+    errorcode = (c); \
+    goto abort; \
+} while (0)
 #undef END
-#define END(c) { errorcode = (c); goto end; }
+#define END(c) do { \
+    errorcode = (c); \
+    goto end; \
+} while (0)
 
 #define VLDBALLOCLIMIT 10000
 #define VLDBALLOCINCR  2048
index 2ae3f28..0dc6a53 100644 (file)
@@ -39,7 +39,10 @@ int vldbversion = 0;
 
 static int index_OK(struct vl_ctx *ctx, afs_int32 blockindex);
 
-#define ERROR_EXIT(code) {error=(code); goto error_exit;}
+#define ERROR_EXIT(code) do { \
+    error = (code); \
+    goto error_exit; \
+} while (0)
 
 /* Hashing algorithm based on the volume id; HASHSIZE must be prime */
 afs_int32
index 6f7bce3..58912ff 100644 (file)
 
 int (*vol_PollProc) (void) = 0;        /* someone must init this */
 
-#define ERROR_EXIT(code) {error = code; goto error_exit;}
+#define ERROR_EXIT(code) do { \
+    error = code; \
+    goto error_exit; \
+} while (0)
 
 /* parameters for idec call - this could just be an IHandle_t, but leaving
  * open the possibility of decrementing the special files as well.
index a6f5ea7..bd61244 100644 (file)
@@ -13,9 +13,7 @@
 #include "daemon_com.h"
 
 #define SYNC_ENUMCASE(en) \
-    case en: \
-        return #en; \
-        break
+    case en: return #en
 
 static_inline char *
 SYNC_res2string(afs_int32 response)
index 7a6d576..9831883 100644 (file)
@@ -436,9 +436,7 @@ do_volop(struct state * state, afs_int32 command, SYNC_response * res)
 
 #define ENUMTOSTRING(en)  #en
 #define ENUMCASE(en) \
-    case en: \
-        return ENUMTOSTRING(en); \
-        break
+    case en: return ENUMTOSTRING(en)
 
 #define FLAGTOSTRING(fl)  #fl
 #define FLAGCASE(bitstr, fl, str, count) \
index ce91dd7..87c1a1f 100644 (file)
@@ -13,9 +13,7 @@
 #include "fssync.h"
 
 #define FSYNC_ENUMCASE(en) \
-    case en: \
-        return #en; \
-        break
+    case en: return #en
 
 static_inline char *
 FSYNC_com2string(afs_int32 command)
index e62a986..f85c2bf 100644 (file)
@@ -1513,7 +1513,7 @@ GetFreeTag(IHandle_t * ih, int vno)
     FDH_SYNC(fdP);
     FDH_UNLOCKFILE(fdP, offset);
     FDH_REALLYCLOSE(fdP);
-    return col;;
+    return col;
 
   badGetFreeTag:
     FDH_UNLOCKFILE(fdP, offset);
index c85b685..cae075a 100644 (file)
@@ -8873,9 +8873,7 @@ VVLRUExtStats_r(struct VLRUExtStats * stats, afs_uint32 nvols)
 
 #define ENUMTOSTRING(en)  #en
 #define ENUMCASE(en) \
-    case en: \
-        return ENUMTOSTRING(en); \
-        break
+    case en: return ENUMTOSTRING(en)
 
 static char *
 vlru_idx_to_string(int idx)
index b6f92cd..dd48623 100644 (file)
@@ -548,9 +548,7 @@ VChangeState_r(Volume * vp, VolState new_state)
 #endif /* AFS_DEMAND_ATTACH_FS */
 
 #define VENUMCASE(en) \
-    case en: \
-        return #en; \
-        break
+    case en: return #en
 
 /**
  * translate a ProgramType code to a string.
index 6d83c1e..62501ff 100644 (file)
@@ -97,7 +97,10 @@ cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL, "verbose");\
 cmd_AddParm(ts, "-encrypt", CMD_FLAG, CMD_OPTIONAL, "encrypt commands");\
 cmd_AddParm(ts, "-noresolve", CMD_FLAG, CMD_OPTIONAL, "don't resolve addresses"); \
 
-#define ERROR_EXIT(code) {error=(code); goto error_exit;}
+#define ERROR_EXIT(code) do { \
+    error = (code); \
+    goto error_exit; \
+} while (0)
 
 int rxInitDone = 0;
 struct rx_connection *tconn;
index e96e816..71870a1 100644 (file)
@@ -165,7 +165,10 @@ do { \
 
 
 /* getting rid of this */
-#define ERROR_EXIT(code) {error=(code); goto error_exit;}
+#define ERROR_EXIT(code) do { \
+    error = (code); \
+    goto error_exit; \
+} while (0)
 
 
 /* Protos for static routines */
@@ -3291,9 +3294,24 @@ DelVol(struct rx_connection *conn, afs_uint32 vid, afs_int32 part,
     return acode;
 }
 
-#define ONERROR(ec, ep, es) if (ec) { fprintf(STDERR, (es), (ep)); error = (ec); goto rfail; }
-#define ONERROR0(ec, es) if (ec) { fprintf(STDERR, (es)); error = (ec); goto rfail; }
-#define ERROREXIT(ec) { error = (ec); goto rfail; }
+#define ONERROR(ec, ep, es) do { \
+    if (ec) { \
+        fprintf(STDERR, (es), (ep)); \
+        error = (ec); \
+        goto rfail; \
+    } \
+} while (0)
+#define ONERROR0(ec, es) do { \
+    if (ec) { \
+        fprintf(STDERR, (es)); \
+        error = (ec); \
+        goto rfail; \
+    } \
+} while (0)
+#define ERROREXIT(ec) do { \
+    error = (ec); \
+    goto rfail; \
+} while (0)
 
 /* Get a "transaction" on this replica.  Create the volume
  * if necessary.  Return the time from which a dump should