Correct some redundant if() clauses 57/13157/9
authorPat Riehecky <riehecky@fnal.gov>
Fri, 1 Jun 2018 21:29:25 +0000 (16:29 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 21 Sep 2018 03:02:38 +0000 (23:02 -0400)
A few if() conditions currently contain redundant syntax, due to typos.
Fix the conditions to actually check different things, according to what
the author probably originally intended. (via cppcheck)

Change-Id: I7e46217e1f84fe65677ada345d227f31f1988fe6
Reviewed-on: https://gerrit.openafs.org/13157
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/budb/procs.c
src/libadmin/client/afs_clientAdmin.c
src/libadmin/vos/vsprocs.c

index cf35576..6fbeb4c 100644 (file)
@@ -1645,7 +1645,7 @@ ListDumps(struct rx_call *call, afs_int32 sflags, afs_int32 groupid,
                                        count * sizeof(afs_int32));
                        }
                        if (!dumps->budb_dumpsList_val
-                           || !dumps->budb_dumpsList_val)
+                            || !flags->budb_dumpsList_val)
                            ABORT(BUDB_NOMEM);
                    }
 
index d0f61f1..aa49358 100644 (file)
@@ -205,7 +205,7 @@ afsclient_TokenGetExisting(const char *cellName, void **tokenHandle,
                                          t_handle->afs_token.ticketLen,
                                          t_handle->afs_token.ticket);
        if ((t_handle->afs_sc[t_handle->sc_index] == NULL)
-           || (t_handle->afs_sc[t_handle->sc_index] == NULL)) {
+           || (t_handle->afs_encrypt_sc[t_handle->sc_index] == NULL)) {
            tst = ADMCLIENTTOKENHANDLENOSECURITY;
            goto fail_afsclient_TokenGetExisting;
        } else {
index ecc618b..f565019 100644 (file)
@@ -4090,8 +4090,7 @@ UV_SetVolume(struct rx_connection *server, afs_int32 partition,
 
     if (tid) {
        etst = AFSVolEndTrans(server, tid, &rcode);
-       /* FIXME: this looks like a typo */
-       if (etst || etst) {
+       if (etst || rcode) {
            if (!tst)
                tst = (etst ? etst : rcode);
        }