windows-afsd-dns-env-20080902
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 2 Sep 2008 23:34:41 +0000 (23:34 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 2 Sep 2008 23:34:41 +0000 (23:34 +0000)
LICENSE MIT

Fix the conditionals so that the right thing happens if AFS_AFSDB_ENV
is not defined.

src/WINNT/afsd/cm_cell.c

index ceaeb8c..8432fd2 100644 (file)
@@ -100,8 +100,13 @@ cm_cell_t *cm_UpdateCell(cm_cell_t * cp, afs_uint32 flags)
         rock.cellp = cp;
         rock.flags = flags;
         code = cm_SearchCellFile(cp->name, NULL, cm_AddCellProc, &rock);
+        if (code == 0) {
+            lock_ObtainMutex(&cp->mx);
+           cp->timeout = time(0) + 7200;
+            lock_ReleaseMutex(&cp->mx);
+        }
 #ifdef AFS_AFSDB_ENV
-        if (code) {
+        else {
             if (cm_dnsEnabled) {
                 int ttl;
 
@@ -124,13 +129,8 @@ cm_cell_t *cm_UpdateCell(cm_cell_t * cp, afs_uint32 flags)
                     lock_ReleaseMutex(&cp->mx);
                 }
            }
-       } else 
+       }
 #endif /* AFS_AFSDB_ENV */
-       {
-            lock_ObtainMutex(&cp->mx);
-           cp->timeout = time(0) + 7200;
-            lock_ReleaseMutex(&cp->mx);
-       }       
     } else {
         lock_ReleaseMutex(&cp->mx);
     }
@@ -277,8 +277,9 @@ cm_cell_t *cm_GetCell_Gen(char *namep, char *newnamep, afs_uint32 flags)
                     cp->timeout = time(0) + ttl;
                 }
             } 
+            else 
 #endif
-            else {
+            {
                 cm_FreeCell(cp);
                 cp = NULL;
                 goto done;