The modified time resolution is one second, so only
stat the cellservdb file at most only once per second.
Change-Id: I7d9a58f9af72b8c36b50374e49c07b4db85285e0
Reviewed-on: http://gerrit.openafs.org/5743
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
char *cellservDB;
struct stat tstat;
int code;
+ time_t now = time(0);
+
+ if (adir->timeCheck == now) {
+ return 1; /* stat no more than once a second */
+ }
+ adir->timeCheck = now;
_afsconf_CellServDBPath(adir, &cellservDB);
if (cellservDB == NULL)
#endif
adir->timeRead = 0; /* just in case */
+ adir->timeCheck = 0;
_afsconf_CellServDBPath(adir, &cellservDB);
if (cellservDB == NULL)
struct afsconf_entry *entries; /* list of cell entries */
struct opr_queue keyList; /* list of keys */
afs_int32 timeRead; /* time stamp of file last read */
+ afs_int32 timeCheck; /* time of last check for update */
struct afsconf_aliasentry *alias_entries; /* cell aliases */
afsconf_secflags securityFlags;
};