windows-afsd-dns-env-20080902

LICENSE MIT

Fix the conditionals so that the right thing happens if AFS_AFSDB_ENV
is not defined.
This commit is contained in:
Jeffrey Altman 2008-09-02 23:34:41 +00:00
parent 8bf17e7c81
commit 9803e84e63

View File

@ -100,8 +100,13 @@ cm_cell_t *cm_UpdateCell(cm_cell_t * cp, afs_uint32 flags)
rock.cellp = cp; rock.cellp = cp;
rock.flags = flags; rock.flags = flags;
code = cm_SearchCellFile(cp->name, NULL, cm_AddCellProc, &rock); 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 #ifdef AFS_AFSDB_ENV
if (code) { else {
if (cm_dnsEnabled) { if (cm_dnsEnabled) {
int ttl; int ttl;
@ -124,13 +129,8 @@ cm_cell_t *cm_UpdateCell(cm_cell_t * cp, afs_uint32 flags)
lock_ReleaseMutex(&cp->mx); lock_ReleaseMutex(&cp->mx);
} }
} }
} else
#endif /* AFS_AFSDB_ENV */
{
lock_ObtainMutex(&cp->mx);
cp->timeout = time(0) + 7200;
lock_ReleaseMutex(&cp->mx);
} }
#endif /* AFS_AFSDB_ENV */
} else { } else {
lock_ReleaseMutex(&cp->mx); 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; cp->timeout = time(0) + ttl;
} }
} }
else
#endif #endif
else { {
cm_FreeCell(cp); cm_FreeCell(cp);
cp = NULL; cp = NULL;
goto done; goto done;